Class AnypointMQOperations
java.lang.Object
com.mulesoft.extension.mq.internal.operation.AnypointMQOperations
Operations for the Anypoint MQ Connector
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidack(AnypointMQConnection connection, String ackToken, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void, Void> callback) Executes an Acknowledgement indicating that the message has been consumed correctly and deletes the message fromIn Flightstatus.voidconsume(AnypointMQConnection connection, String destination, ConsumerAckMode acknowledgementMode, long acknowledgementTimeout, TimeUnit acknowledgementTimeoutUnit, long pollingTime, TimeUnit pollingTimeUnit, org.mule.runtime.extension.api.runtime.process.CompletionCallback<InputStream, AnypointMQMessageAttributes> callback) voidnack(AnypointMQConnection connection, String ackToken, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void, Void> callback) Executes an Not Acknowledgement and change the status of the message fromIn FlighttoIn Queueto be consumed again for a subscribervoidpublish(org.mule.runtime.extension.api.runtime.streaming.StreamingHelper streamingHelper, AnypointMQConnection connection, String destination, AnypointMQMessageGroup messageGroup, org.mule.runtime.extension.api.runtime.process.CompletionCallback<InputStream, AnypointMQMessagePublishAttributes> callback)
-
Constructor Details
-
AnypointMQOperations
public AnypointMQOperations()
-
-
Method Details
-
publish
@MediaType(value="*/*", strict=false) @Throws(AnypointMQPublishErrorTypeProvider.class) public void publish(org.mule.runtime.extension.api.runtime.streaming.StreamingHelper streamingHelper, @Connection AnypointMQConnection connection, @DisplayName("Destination") @Summary("The name of the Queue or Exchange where the message should be published") String destination, @ParameterGroup(name="Message") AnypointMQMessageGroup messageGroup, org.mule.runtime.extension.api.runtime.process.CompletionCallback<InputStream, AnypointMQMessagePublishAttributes> callback) throws org.mule.runtime.api.connection.ConnectionException- Parameters:
streamingHelper- Mule StreamingHelper.connection- The connection to Anypoint MQ.destination- Queue or Exchange name from where to fetch a Message- Throws:
org.mule.runtime.api.connection.ConnectionException
-
consume
@MediaType(value="*/*", strict=false) @Throws(AnypointMQConsumeErrorTypeProvider.class) public void consume(@Connection AnypointMQConnection connection, @DisplayName("Queue") @Summary("The name of the Queue from which to consume a message") String destination, @Summary("The Acknowledgement mode to use on the consumed message") @Optional(defaultValue="IMMEDIATE") ConsumerAckMode acknowledgementMode, @Summary("Duration that a message is held by a consumer waiting for an ACK or NACK, before returning to the Queue for redelivery") @Optional(defaultValue="0") long acknowledgementTimeout, @Summary("Time unit to be used in the acknowledgementTimeout configuration") @Optional(defaultValue="MILLISECONDS") TimeUnit acknowledgementTimeoutUnit, @Summary("How much time to be waited if the requested messages are not ready to be consumed") @Optional(defaultValue="10000") long pollingTime, @Summary("Time unit to be used in the pollingTime configuration") @Optional(defaultValue="MILLISECONDS") TimeUnit pollingTimeUnit, org.mule.runtime.extension.api.runtime.process.CompletionCallback<InputStream, AnypointMQMessageAttributes> callback) throws org.mule.runtime.api.connection.ConnectionException- Parameters:
connection- The connection to Anypoint MQ.destination- Queue or Exchange name from where to fetch a MessageacknowledgementMode- Acknowledgement mode to use for the messages retrieved.acknowledgementTimeout- Duration that a message is held by a consumer waiting for an Acknowledgement or Not Acknowledgement. After that duration elapses, the message is again available to any consumer.acknowledgementTimeoutUnit- Time unit to be used in the acknowledgementTimeout configurationpollingTime- How much time to be waited if the requested messages are not ready to be consumed.pollingTimeUnit- Time unit to be used in the pollingTime configuration- Throws:
org.mule.runtime.api.connection.ConnectionException
-
ack
@Throws(AnypointMQAckErrorTypeProvider.class) public void ack(@Connection AnypointMQConnection connection, @Summary("The `ackToken` of the message, which was received when message was consumed") String ackToken, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void, Void> callback) throws org.mule.runtime.api.connection.ConnectionExceptionExecutes an Acknowledgement indicating that the message has been consumed correctly and deletes the message fromIn Flightstatus.- Parameters:
connection- The connection to Anypoint MQ.ackToken- The `ackToken` of the message, which was received when message was consumed. `ackToken` will only be created when acknowledgementMode="MANUAL" is used.- Throws:
org.mule.runtime.api.connection.ConnectionException
-
nack
@Throws(AnypointMQNackErrorTypeProvider.class) public void nack(@Connection AnypointMQConnection connection, @Summary("The `ackToken` of the message, which was received when message was consumed") String ackToken, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void, Void> callback) throws org.mule.runtime.api.connection.ConnectionExceptionExecutes an Not Acknowledgement and change the status of the message fromIn FlighttoIn Queueto be consumed again for a subscriber- Parameters:
connection- The connection to Anypoint MQ.ackToken- The `ackToken` of the message, which was received when message was consumed. `ackToken` will only be created when acknowledgementMode="MANUAL" is used.- Throws:
org.mule.runtime.api.connection.ConnectionException
-