Skip to content

Commit

Permalink
Merge pull request #17 from Financial-Times/feature/circlecl-2
Browse files Browse the repository at this point in the history
Feature/circlecl 2
  • Loading branch information
Keith Hatton authored May 18, 2018
2 parents 5f22776 + e876961 commit 6e6da75
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
jobs:
build:
docker:
- image: coco/dropwizardbase-internal:v1.0.3
steps:
- checkout
- run:
name: Maven
command: mvn clean verify
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ atlassian-ide-plugin.xml

# NetBeans specific files/directories
.nbattrs
/bin/
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#message-queue-consumer
# message-queue-consumer

Library which does polling to consume messages from a message queue via an http proxy. Supports group and topic semantics.

Configuration
## Configuration

```
topicName - name of the topic from which to consume messages
groupName - consumer group
queueProxyHost - location of the http proxy(eg "http://localhost:8082")
queue - used for dynamic routing. This values will be passed on as an http Host header on all the requests
backoffPeriod - period in milliseconds for which the app will sleep before trying to consume messages
- backoff is applied when queue is empty(last consume request returned no messages) or exception occurred when trying to connect to the proxy
- backoff is applied when queue is empty(last consume request returned no messages) or exception occurred when trying to connect to the proxy
autoCommit - boolean flag which configures autoCommit when consuming messages. If true offsets are committed if the consume request to the proxy returns 200.
- if false offsets are manually committed after the batch of messages are processed
- because of the proxy limitations the recommendations are to use autocommit true for topics with small messages
Expand All @@ -20,14 +21,11 @@ offsetReset - possible values are "smallest" and "largest"
- using smallest will impact the memory usage of the proxy
streamCount - number of threads to use for processing messages
- each thread will create a new proxy consumer instance which will be assigned to different kafka partition(s)
The library expects a jersey http client to be passed in. Make sure the client you provide supports overriding http Host header.
```
The library expects a jersey http client to be passed in. Make sure the client you provide supports overriding http Host header.

How to use
```
#Add library as a dependency
#Configure consumer with the params explained above
#Add implementation for: com.ft.message.consumer.MessageListener
```
## How to use

1. Add library as a dependency
1. Configure consumer with the params explained above
1. Add implementation for: `com.ft.message.consumer.MessageListener`

0 comments on commit 6e6da75

Please sign in to comment.