Skip to content

DSL improvements for broker-backed pub/sub channels. #3192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garyrussell opened this issue Feb 21, 2020 · 0 comments · Fixed by #3193
Closed

DSL improvements for broker-backed pub/sub channels. #3192

garyrussell opened this issue Feb 21, 2020 · 0 comments · Fixed by #3193

Comments

@garyrussell
Copy link
Contributor

Core (in-memory) pub/sub channels can be configured with in-line subscriptions:

.publishSubscribeChannel(c -> c
		.subscribe(sf -> sf.handle(
				kafkaMessageHandler(producerFactory(), TEST_TOPIC1)
						.timestampExpression("T(Long).valueOf('1487694048633')"),
				e -> e.id("kafkaProducer1")))
		.subscribe(sf -> sf.handle(
				kafkaMessageHandler(producerFactory(), TEST_TOPIC2)
						.timestamp(m -> 1487694048644L),
				e -> e.id("kafkaProducer2")))
)

Message broker-backed pub/sub channels have the same semantics as in-memory pub/sub in an application generally (distribution to multiple subscribers) but there is no support for in-line subscriptions in the DSL.

It may be difficult/impossible to support but we should at least explore the possibility.

@garyrussell garyrussell added this to the Backlog milestone Feb 21, 2020
artembilan added a commit to artembilan/spring-integration that referenced this issue Feb 24, 2020
Fixes spring-projects#3192

* Introduce a `BroadcastCapableChannel` abstract to indicate those `SubscribableChannel`
implementations which can provide a pub-sub functionality
* Implement a `BroadcastCapableChannel` in broker-baked channels with pub-sub option
* Introduce a `BaseIntegrationFlowDefinition.publishSubscribeChannel()` based
on the `BroadcastCapableChannel` and `BroadcastPublishSubscribeSpec` to let to
configure sub-flow subscribers in fluent manner
@artembilan artembilan modified the milestones: Backlog, 5.3.M3 Feb 24, 2020
@artembilan artembilan removed the status: discussion-required Needs a discussion with the team label Feb 24, 2020
@artembilan artembilan self-assigned this Feb 24, 2020
garyrussell pushed a commit that referenced this issue Feb 25, 2020
* GH-3192: pub-sub DSL for broker-backed channels

Fixes #3192

* Introduce a `BroadcastCapableChannel` abstract to indicate those `SubscribableChannel`
implementations which can provide a pub-sub functionality
* Implement a `BroadcastCapableChannel` in broker-baked channels with pub-sub option
* Introduce a `BaseIntegrationFlowDefinition.publishSubscribeChannel()` based
on the `BroadcastCapableChannel` and `BroadcastPublishSubscribeSpec` to let to
configure sub-flow subscribers in fluent manner

* * Add some JavaDocs and document new feature

* * Show the channel bean definition in the doc
* Fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants