You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ This library also uses:
58
58
### Setup
59
59
60
60
If you are using maven, include the library in your `pom.xml`:
61
+
61
62
```xml
62
63
<dependency>
63
64
<groupId>org.zalando</groupId>
@@ -66,7 +67,10 @@ If you are using maven, include the library in your `pom.xml`:
66
67
</dependency>
67
68
```
68
69
70
+
The latest available version is visible in the Maven central badge at the top of this README.
71
+
69
72
Use `@EnableNakadiProducer` annotation to activate spring boot starter auto configuration:
73
+
70
74
```java
71
75
@SpringBootApplication
72
76
@EnableNakadiProducer
@@ -81,6 +85,23 @@ The library uses flyway migrations to set up its own database schema `nakadi_eve
81
85
82
86
### Nakadi communication configuration
83
87
88
+
By default, Nakadi-producer-spring-boot starter uses the Fahrschein library to submit its events. It needs some configuration to know how to do this – we describe three ways here (basically in order of ease of use):
89
+
90
+
* Using existing Fahrschein setup
91
+
* Letting this library set things up
92
+
* Implement Nakadi communication yourself
93
+
94
+
#### Using existing Fahrschein setup
95
+
96
+
If you are already using the [Fahrschein library](https://github.com/zalando-nakadi/fahrschein) directly (e.g. for event consumption) and have already a configured `org.zalando.fahrschein.NakadiClient` object, just make sure it is available as a Spring bean. Nakadi-Producer-Spring-Boot-Starter will pick it up and use it directly.
97
+
98
+
The configurations in the next section are then not needed at all.
99
+
100
+
#### Letting this library set things up
101
+
102
+
If you want Nakadi-Producer-Spring-Boot-Starter to configure the connection to Nakadi, you'll need to set some properties
103
+
(and/or create beans).
104
+
84
105
You must tell the library, where it can reach your Nakadi instance:
85
106
```yaml
86
107
nakadi-producer:
@@ -116,6 +137,26 @@ nakadi-producer:
116
137
117
138
If you do not use the STUPS Tokens library, you can implement token retrieval yourself by defining a Spring bean of type `org.zalando.nakadiproducer.AccessTokenProvider`. The starter will detect it and call it once for each request to retrieve the token.
118
139
140
+
#### Implement Nakadi communication yourself
141
+
142
+
If you don't like Fahrschein, you can implement the communication with Nakadi yourself. Just provide an implementation of the `NakadiPublishingClient` interface as a Spring bean. Nakadi-producer-spring-boot-starter will just use that bean. (This is used in the [test support](#test-support) described below.)
143
+
144
+
You can then also exclude the Fahrschein dependency:
Copy file name to clipboardExpand all lines: nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/NakadiProducerAutoConfiguration.java
0 commit comments