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
+21Lines changed: 21 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,22 @@ 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 support two ways:
89
+
90
+
* Using existing Fahrschein setup
91
+
* Letting this library set things up
92
+
93
+
#### Using existing Fahrschein setup
94
+
95
+
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.
96
+
97
+
The configuration in the next section is then not needed at all.
98
+
99
+
#### Letting this library set things up
100
+
101
+
If you want Nakadi-Producer-Spring-Boot-Starter to configure the connection to Nakadi, you'll need to set some properties
102
+
(and/or create beans).
103
+
84
104
You must tell the library, where it can reach your Nakadi instance:
85
105
```yaml
86
106
nakadi-producer:
@@ -116,6 +136,7 @@ nakadi-producer:
116
136
117
137
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
138
139
+
119
140
### Creating events
120
141
121
142
The typical use case for this library is to publish events like creating or updating of some objects.
Copy file name to clipboardExpand all lines: nakadi-producer-spring-boot-starter/src/main/java/org/zalando/nakadiproducer/NakadiProducerAutoConfiguration.java
0 commit comments