Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Default

Description

size

1000

The maximum size of the SEDA queue.

concurrentConsumers

1

Camel 1.6.1/2.0: Number of concurrent threads processing exchanges.

waitForTaskToComplete

IfReplyExpected

Camel 2.0: Option to specify whether the caller should wait for the async task to complete or not before continuing. The following three options are supported: Always, Never or IfReplyExpected. The first two values are self-explanatory. The last value, IfReplyExpected, will only wait if the message is Request Reply based. The default option is IfReplyExpected. See more information about Async messaging.

timeout

30000

Camel 2.0: Timeout in millis a seda producer will at most waiting for an async task to complete. See waitForTaskToComplete and Async for more details. In Camel 2.2 you can now disable timeout by using 0 or a negative value.

multipleConsumers

false

Camel 2.2: Specifies whether multiple consumers is allowed or not. If enabled you can use SEDA for a pubsub kinda style messaging. Send a message to a seda queue and have multiple consumers receive a copy of the message.

Changes in Camel 2.0

In Camel 2.0 the Seda component supports using Request Reply, where the caller will wait for the Async route to complete. For instance:

...

The "Hello World" message will be consumed from the SEDA queue from another thread for further processing. Since this is from a unit test, it will be sent to a mock endpoint where we can do assertions in the unit test.

Using multipleConsumers

Available as of Camel 2.2

In this example we have defined two consumers and registered them as spring beans.

Wiki Markup
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/example/fooEventRoute.xml}

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.

Wiki Markup
{snippet:id=e1|lang=java|url=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/example/FooEventConsumer.java}
Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also

...