This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new ac29737 Polish seda multipleConsumers docs (#5283) ac29737 is described below commit ac29737e1b3ec8d1f82cf59ab0372708962c31f9 Author: llowinge <llowi...@redhat.com> AuthorDate: Wed Mar 31 14:28:52 2021 +0200 Polish seda multipleConsumers docs (#5283) --- .../camel-seda/src/main/docs/seda-component.adoc | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/components/camel-seda/src/main/docs/seda-component.adoc b/components/camel-seda/src/main/docs/seda-component.adoc index 6557138..71e3810 100644 --- a/components/camel-seda/src/main/docs/seda-component.adoc +++ b/components/camel-seda/src/main/docs/seda-component.adoc @@ -265,16 +265,39 @@ unit test. *Since Camel 2.2* -In this example we have defined two consumers and registered them as -spring beans. +In this example we have defined two consumers. + +[source,java] +---- + @Test + public void testSameOptionsProducerStillOkay() throws Exception { + getMockEndpoint("mock:foo").expectedBodiesReceived("Hello World"); + getMockEndpoint("mock:bar").expectedBodiesReceived("Hello World"); + + template.sendBody("seda:foo", "Hello World"); + + assertMockEndpointsSatisfied(); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from("seda:foo?multipleConsumers=true").routeId("foo").to("mock:foo"); + from("seda:foo?multipleConsumers=true").routeId("bar").to("mock:bar"); + } + }; + } +---- + Since we have specified *multipleConsumers=true* on the seda foo endpoint we can have those two consumers receive their own copy of the message as a kind of pub-sub style messaging. As the beans are part of an unit test they simply send the message to a -mock endpoint, but notice how we can use @Consume to consume from the -seda queue. +mock endpoint. == Extracting queue information.