org.apache.camel.component.jms
Class JmsConsumer
java.lang.Object
org.apache.camel.support.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.component.jms.JmsConsumer
- All Implemented Interfaces:
- org.apache.camel.Consumer, org.apache.camel.RouteAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
public class JmsConsumer
- extends org.apache.camel.impl.DefaultConsumer
- implements org.apache.camel.SuspendableService
A Consumer
which uses Spring's AbstractMessageListenerContainer
implementations
to consume JMS messages.
- Version:
- See Also:
DefaultJmsMessageListenerContainer
,
SimpleJmsMessageListenerContainer
Fields inherited from class org.apache.camel.impl.DefaultConsumer |
log |
Fields inherited from class org.apache.camel.support.ServiceSupport |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
Constructor Summary |
JmsConsumer(JmsEndpoint endpoint,
org.apache.camel.Processor processor,
org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer)
|
Methods inherited from class org.apache.camel.impl.DefaultConsumer |
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, handleException, handleException, setExceptionHandler, setRoute, toString |
Methods inherited from class org.apache.camel.support.ServiceSupport |
doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
Methods inherited from interface org.apache.camel.SuspendableService |
isSuspended, resume, suspend |
Methods inherited from interface org.apache.camel.Service |
start, stop |
JmsConsumer
public JmsConsumer(JmsEndpoint endpoint,
org.apache.camel.Processor processor,
org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer)
getEndpoint
public JmsEndpoint getEndpoint()
- Specified by:
getEndpoint
in interface org.apache.camel.Consumer
- Overrides:
getEndpoint
in class org.apache.camel.impl.DefaultConsumer
getListenerContainer
public org.springframework.jms.listener.AbstractMessageListenerContainer getListenerContainer()
throws Exception
- Throws:
Exception
getEndpointMessageListener
public EndpointMessageListener getEndpointMessageListener()
createMessageListener
protected void createMessageListener(JmsEndpoint endpoint,
org.apache.camel.Processor processor)
createMessageListenerContainer
protected void createMessageListenerContainer()
throws Exception
- Throws:
Exception
startListenerContainer
public void startListenerContainer()
- Starts the JMS listener container
Can be used to start this consumer later if it was configured to not auto startup.
testConnectionOnStartup
protected void testConnectionOnStartup()
throws org.apache.camel.FailedToCreateConsumerException
- Pre tests the connection before starting the listening.
In case of connection failure the exception is thrown which prevents Camel from starting.
- Throws:
org.apache.camel.FailedToCreateConsumerException
- is thrown if testing the connection failed
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class org.apache.camel.impl.DefaultConsumer
- Throws:
Exception
prepareAndStartListenerContainer
protected void prepareAndStartListenerContainer()
stopAndDestroyListenerContainer
protected void stopAndDestroyListenerContainer()
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class org.apache.camel.impl.DefaultConsumer
- Throws:
Exception
doSuspend
protected void doSuspend()
throws Exception
- Overrides:
doSuspend
in class org.apache.camel.support.ServiceSupport
- Throws:
Exception
doResume
protected void doResume()
throws Exception
- Overrides:
doResume
in class org.apache.camel.support.ServiceSupport
- Throws:
Exception
Apache Camel