Skip to content

Commit

Permalink
version 0.6-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Gsantomaggio committed Jun 10, 2021
1 parent 8423b6e commit 72ed104
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ vet
.DS_Store
perfTest/
.vagrant/
local/
45 changes: 23 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# GO stream client for RabbitMQ streaming queues
---
![Build](https://github.com/rabbitmq/rabbitmq-stream-go-client/workflows/Build/badge.svg)
[![codecov](https://codecov.io/gh/Gsantomaggio/go-stream-client/branch/main/graph/badge.svg?token=HZD4S71QIM)](https://codecov.io/gh/Gsantomaggio/go-stream-client)

Experimental client
for [RabbitMQ Stream Queues](https://github.com/rabbitmq/rabbitmq-server/tree/master/deps/rabbitmq_stream)
Experimental client for [RabbitMQ Stream Queues](https://github.com/rabbitmq/rabbitmq-server/tree/master/deps/rabbitmq_stream)

### Download
---

```
go get -u github.com/rabbitmq/rabbitmq-stream-go-client@v0.5-alpha
go get -u github.com/rabbitmq/rabbitmq-stream-go-client@v0.6-alpha
```

### Getting started
---

- Run RabbitMQ docker image with streaming:
```
docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 -p 15672:15672 \
-e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbitmq_stream advertised_host localhost" \
pivotalrabbitmq/rabbitmq-stream
```
- Run "getting started" example:
```
go run examples/getting_started.go
```
Run RabbitMQ docker image with streaming:
```
docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 -p 15672:15672 \
-e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbitmq_stream advertised_host localhost" \
pivotalrabbitmq/rabbitmq-stream
```

Run "getting started" example:
```
go run examples/getting_started.go
```

See [examples](./examples/) for more use cases

### Performance test tool is an easy way to do some test:

Expand All @@ -36,25 +37,25 @@ go run perfTest/perftest.go silent
### API
---

The API are generally composed by mandatory arguments and optional arguments the optional arguments can be set in the
standard go way as:
The API are composed by mandatory and optional arguments.
The optional be set in the standard go way as:

```golang
env, err := stream.NewEnvironment(
&stream.EnvironmentOptions{
ConnectionParameters: stream.Broker{
Host: "localhost",
Port: 5551,
Port: 5552,
User: "guest",
Password: "guest",
},
MaxProducersPerClient: 3,
MaxConsumersPerClient: 3,
MaxProducersPerClient: 1,
MaxConsumersPerClient: 1,
},
)
```

or using Builders as:
or using builders ( the suggested way):

```golang
env, err := stream.NewEnvironment(
Expand All @@ -78,10 +79,10 @@ The suggested way is to use builders.
---

```shell
make build
make
```

You need a docker image running to execute the tests in this way:
You need a docker image running to execute the tests:

```
docker run -it --rm --name rabbitmq -p 5552:5552 \
Expand Down
2 changes: 1 addition & 1 deletion pkg/stream/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (consumer *Consumer) Commit() error {
length := 2 + 2 + 2 + len(consumer.options.ConsumerName) + 2 +
len(consumer.options.streamName) + 8
var b = bytes.NewBuffer(make([]byte, 0, length+4))
writeProtocolHeader(b, length, commandCommitOffset) // correlation ID not used yet, may be used if commit offset has a confirm
writeProtocolHeader(b, length, commandCommitOffset)

writeString(b, consumer.options.ConsumerName)
writeString(b, consumer.options.streamName)
Expand Down
52 changes: 0 additions & 52 deletions remove_all_queues.py

This file was deleted.

0 comments on commit 72ed104

Please sign in to comment.