README.md in delivery_boy-1.0.1 vs README.md in delivery_boy-1.1.0
- old
+ new
@@ -64,25 +64,25 @@
```ruby
# app/controllers/comments_controller.rb
class CommentsController < ApplicationController
def create
@comment = Comment.create!(params)
-
+
event = {
name: "comment_created",
data: {
comment_id: @comment.id
user_id: current_user.id
}
}
-
+
# This will queue the two messages in the internal buffer.
DeliveryBoy.produce(comment.to_json, topic: "comments")
DeliveryBoy.produce(event.to_json, topic: "activity")
-
+
# This will deliver all messages in the buffer to Kafka.
- # This call is blocking.
+ # This call is blocking.
DeliveryBoy.deliver_messages
end
end
```
@@ -218,15 +218,19 @@
##### `ssl_client_cert_key`
A PEM encoded client cert key to use with an SSL connection. Must be used in combination with `ssl_client_cert`.
+##### `ssl_client_cert_key_password`
+
+The password required to read the ssl_client_cert_key. Must be used in combination with ssl_client_cert_key.
+
#### SASL Authentication and authorization
See [ruby-kafka](https://github.com/zendesk/ruby-kafka#authentication-using-sasl) for more information.
-Use either `sasl_gssapi_*` _or_ `sasl_plain_*`, not both.
+Use it through `GSSAPI`, `PLAIN` _or_ `OAUTHBEARER`.
##### `sasl_gssapi_principal`
The GSSAPI principal.
@@ -243,9 +247,28 @@
The username used to authenticate.
##### `sasl_plain_password`
The password used to authenticate.
+
+##### `sasl_oauth_token_provider`
+
+A instance of a class which implements the `token` method.
+As described in [ruby-kafka](https://github.com/zendesk/ruby-kafka/tree/c3e90bc355fad1e27b9af1048966ff08d3d5735b#oauthbearer)
+
+```ruby
+class TokenProvider
+ def token
+ "oauth-token"
+ end
+end
+
+DeliveryBoy.configure do |config|
+ config.sasl_oauth_token_provider = TokenProvider.new
+ config.ssl_ca_certs_from_system = true
+end
+```
+
### Testing
DeliveryBoy provides a test mode out of the box. When this mode is enabled, messages will be stored in memory rather than being sent to Kafka. If you use RSpec, enabling test mode is as easy as adding this to your spec helper: