public abstract class AbstractSubscription extends java.lang.Object implements Subscription
Constructor and Description |
---|
AbstractSubscription(org.apache.camel.Processor processor) |
Modifier and Type | Method and Description |
---|---|
Subscription |
addPreprocessor(org.apache.camel.Processor preprocessor)
Adds a preprocessor to the subscription route.
|
Subscription |
filterEvents(java.lang.String simpleFilter)
Filters events out on the EDA client side so consumers don't have to do
this themselves.
|
Subscription |
filterEvents(java.lang.String header,
java.lang.String value)
Filters events out on the EDA client side so consumers don't have to do
this themselves.
|
Subscription |
filterEventsOnServerSide(java.lang.String serverSideFilter)
Filters events out on the Event Bus (server side filtering).
|
java.util.List<Configuration> |
getConfigurations()
Returns an unmodifiable ordered list containing the different
configurations used by this subscription.
|
java.util.List<org.apache.camel.Processor> |
getPreprocessors()
Returns an unmodifiable ordered list of all the preprocessors added by
EDA clients to this subscription.
|
org.apache.camel.Processor |
getProcessor()
Provides a reference to the last processor of the processing chain which
will receive the events once all other operations have been completed.
|
Subscription |
orderEvents()
Enables reordering of events by the time-stamp in $Event$Start header
for consumers using this subscription.
|
Subscription |
orderEvents(OrderEventsConfiguration config)
Configures this subscription to reorder events as specified by custom configuration.
|
Subscription |
suppressDuplicateEvents() |
Subscription |
suppressDuplicateEvents(DuplicateEventsConfiguration config) |
Subscription |
useDurableSubscription(java.lang.String clientId,
java.lang.String subscriptionName)
Creates a durable subscription which receive messages while the subscriber is not active.
For more detailed information please see Session.createDurableSubscriber(javax.jms.Topic, String) and
Connection.setClientID(String) |
Subscription |
useThreadPool(int poolSize)
Configures the subscription to use a thread pool with the specified size.
|
Subscription |
useThreadPool(ThreadPoolConfiguration config)
Configures the subscription to use a thread pool with the specified
configuration.
|
public AbstractSubscription(org.apache.camel.Processor processor)
public org.apache.camel.Processor getProcessor()
Subscription
getProcessor
in interface Subscription
#getPreprocessors()} - Returns a list of all previously added
preprocessors.
public java.util.List<Configuration> getConfigurations()
Subscription
Subscription.suppressDuplicateEvents()
a new configuration
will be added to the list.getConfigurations
in interface Subscription
public java.util.List<org.apache.camel.Processor> getPreprocessors()
Subscription
getPreprocessors
in interface Subscription
#addPreprocessor(Processor)} - Used for adding preprocessors.
public Subscription addPreprocessor(org.apache.camel.Processor preprocessor)
Subscription
addPreprocessor
in interface Subscription
preprocessor
- - The preprocessor that has to be added to the subscription
route.public Subscription useDurableSubscription(java.lang.String clientId, java.lang.String subscriptionName)
Subscription
Session.createDurableSubscriber(javax.jms.Topic, String)
and
Connection.setClientID(String)
useDurableSubscription
in interface Subscription
clientId
- an unique client ID which can only be used by a single JMS connection instance.subscriptionName
- durable subscriber name for specifying durable topic subscriptions.public Subscription suppressDuplicateEvents()
suppressDuplicateEvents
in interface Subscription
public Subscription suppressDuplicateEvents(DuplicateEventsConfiguration config)
suppressDuplicateEvents
in interface Subscription
public Subscription filterEvents(java.lang.String header, java.lang.String value)
Subscription
filterEvents("${header.<name>} == '<value>'")
. For
example the following code
filterEvents("$Event$Kind", "Event")
is equivalent to
filterEvents("${header.$Event$Kind} == 'Event'")
. The later
one uses Camel's Simple Language directly. Both will only allow events of
kind "Event" to pass through, all "Heartbeat" events will be filtered
out.filterEvents
in interface Subscription
header
- - The name of the header you want your filter to be based on.value
- - The value of the header you want your filter to be based on.#filterEvents(String)} - Provides more powerful client side
filter capabilities based on Camel's Simple language.
,
#filterEventsOnServerSide(String)} - Filters events out on
the server side using a JMS message selector.
public Subscription filterEvents(java.lang.String simpleFilter)
Subscription
filterEvents("${header.$Event$Kind} == 'Event'")
. This code
will only allow events of kind "Event" to pass through, all "Heartbeat"
events will be filtered out.filterEvents
in interface Subscription
simpleFilter
- - A Camel simple language filter. For more information check
Apache Camel online documentation.#filterEventsOnServerSide(String)} - Filters events out on
the server side using a JMS message selector.
,
Camel's Simple
Languagepublic Subscription filterEventsOnServerSide(java.lang.String serverSideFilter)
Subscription
filterEventsOnServerSide("$Event$Kind == 'Event'")
. This code
will only allow events of kind "Event" to pass through, all "Heartbeat"
events will be filtered out, all events will be filtered on the JMS
provider side.filterEventsOnServerSide
in interface Subscription
serverSideFilter
- - A JMS message selector filter.public Subscription orderEvents()
Subscription
orderEvents
in interface Subscription
OrderEventsConfiguration
,
Resequencer EIPpublic Subscription orderEvents(OrderEventsConfiguration config)
Subscription
OrderEventsConfiguration
.orderEvents
in interface Subscription
config
- - A set of parameters used for reordering. For example, a header name by which the events are compared.public Subscription useThreadPool(int poolSize)
Subscription
useThreadPool
in interface Subscription
poolSize
- The size of the pool. In this case it's also equal to the
maximum pool size.public Subscription useThreadPool(ThreadPoolConfiguration config)
Subscription
useThreadPool
in interface Subscription
config
- - The configuration which should be used for configuring the
thread pool parameters such as default size, maximum pool
size, and thread name template to be used.