Class JmsXaPollingMessageConsumerDelegate
java.lang.Object
org.mule.jms.commons.internal.source.polling.JmsXaPollingMessageConsumerDelegate
- All Implemented Interfaces:
MessageConsumerDelegate
MessageConsumerDelegate implementation which consumes messages inside XA Transactions doing polling.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionJmsXaPollingMessageConsumerDelegate(JmsTransactionalConnection connection, JmsSupport jmsSupport, String destination, ConsumerType consumerType, JmsConfig<?, ?> config, String selector, JmsSessionManager sessionManager, org.mule.sdk.api.connectivity.ConnectionProvider<JmsTransactionalConnection> connectionProvider, org.mule.runtime.api.scheduler.Scheduler scheduler, String inboundContentType, String inboundEncoding, org.mule.runtime.extension.api.runtime.source.SourceCallback<Object, JmsAttributes> sourceCallback, JmsConnectionExceptionResolver exceptionResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateConsumers(int numberOfConsumers) Creates and start N consumers, where N is defined by the paramnumberOfConsumers.voidvoidonError(org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext, org.mule.runtime.api.message.Error error) Communicates when a message has not been successfully processed in a flow.voidonSuccess(org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext) Communicates when a message has been successfully processed in a flow.protected voidreschedulePolling(Runnable runnable) voidstop()Request to stop all the message consumers.
-
Constructor Details
-
JmsXaPollingMessageConsumerDelegate
public JmsXaPollingMessageConsumerDelegate(JmsTransactionalConnection connection, JmsSupport jmsSupport, String destination, ConsumerType consumerType, JmsConfig<?, ?> config, String selector, JmsSessionManager sessionManager, org.mule.sdk.api.connectivity.ConnectionProvider<JmsTransactionalConnection> connectionProvider, org.mule.runtime.api.scheduler.Scheduler scheduler, String inboundContentType, String inboundEncoding, org.mule.runtime.extension.api.runtime.source.SourceCallback<Object, JmsAttributes> sourceCallback, JmsConnectionExceptionResolver exceptionResolver)
-
-
Method Details
-
createConsumers
public void createConsumers(int numberOfConsumers) throws org.mule.runtime.api.connection.ConnectionException Creates and start N consumers, where N is defined by the paramnumberOfConsumers.- Specified by:
createConsumersin interfaceMessageConsumerDelegate- Parameters:
numberOfConsumers- number of consumers to create and start.- Throws:
org.mule.runtime.api.connection.ConnectionException- If an error occurs trying to create and start the consumers.
-
onSuccess
public void onSuccess(org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext) Communicates when a message has been successfully processed in a flow.- Specified by:
onSuccessin interfaceMessageConsumerDelegate- Parameters:
callbackContext- Context with references of the processed message.
-
onError
public void onError(org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext, org.mule.runtime.api.message.Error error) Communicates when a message has not been successfully processed in a flow.- Specified by:
onErrorin interfaceMessageConsumerDelegate- Parameters:
callbackContext- Context with references of the processed message.error- Produced error on the flow.
-
reschedulePolling
-
stop
public void stop()Request to stop all the message consumers.- Specified by:
stopin interfaceMessageConsumerDelegate
-
disableConsumers
public void disableConsumers()- Specified by:
disableConsumersin interfaceMessageConsumerDelegate
-