Class AnypointMQOperations

java.lang.Object
com.mulesoft.extension.mq.internal.operation.AnypointMQOperations

public class AnypointMQOperations extends Object
Operations for the Anypoint MQ Connector
Since:
3.0.0
  • 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 Message
      acknowledgementMode - 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 configuration
      pollingTime - 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.ConnectionException
      Executes an Acknowledgement indicating that the message has been consumed correctly and deletes the message from In Flight status.
      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.ConnectionException
      Executes an Not Acknowledgement and change the status of the message from In Flight to In Queue to 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