If an application is using Fahrschein directly (for reading events) and this library for producing events, one needs to configure the token stuff (and the Nakadi URL) twice, and one gets two Fahrschein NakadiClients.
Instead, when there is already a spring bean of type org.zalando.fahrschein.NakadiClient, it should just be used for submitting events.
This could be done by having another bean definition like this:
@Bean
NakadiPublishingClient nakadiProducerPublishingClient(NakadiClient fahrscheinNakadiClient) {
return new FahrscheinNakadiPublishingClient(fahrscheinNakadiClient);
}
It would need to be conditional on an existing NakadiClient bean.
If an application is using Fahrschein directly (for reading events) and this library for producing events, one needs to configure the token stuff (and the Nakadi URL) twice, and one gets two Fahrschein NakadiClients.
Instead, when there is already a spring bean of type
org.zalando.fahrschein.NakadiClient
, it should just be used for submitting events.This could be done by having another bean definition like this:
It would need to be conditional on an existing NakadiClient bean.