Class AnypointMQSource

java.lang.Object
org.mule.runtime.extension.api.runtime.source.Source<InputStream,AnypointMQMessageAttributes>
com.mulesoft.extension.mq.internal.source.AnypointMQSource
All Implemented Interfaces:
org.mule.runtime.extension.api.runtime.connectivity.Reconnectable

@Alias("subscriber") @MediaType(value="*/*", strict=false) @Throws(AnypointMQSubscriberErrorTypeProvider.class) public class AnypointMQSource extends org.mule.runtime.extension.api.runtime.source.Source<InputStream,AnypointMQMessageAttributes> implements org.mule.runtime.extension.api.runtime.connectivity.Reconnectable
Anypoint MQ Subscriber Message Source, retrieves messages from the given destination name.
Since:
2.0.0
  • Field Details

  • Constructor Details

    • AnypointMQSource

      public AnypointMQSource()
  • Method Details

    • onStart

      public void onStart(org.mule.runtime.extension.api.runtime.source.SourceCallback<InputStream,AnypointMQMessageAttributes> callback) throws org.mule.runtime.api.connection.ConnectionException
      Specified by:
      onStart in class org.mule.runtime.extension.api.runtime.source.Source<InputStream,AnypointMQMessageAttributes>
      Throws:
      org.mule.runtime.api.connection.ConnectionException
    • reconnect

      public void reconnect(org.mule.runtime.api.connection.ConnectionException exception, org.mule.runtime.extension.api.runtime.connectivity.ReconnectionCallback reconnectionCallback)
      Participates in the runtime's per-source reconnection contract. Without this the runtime has no reconnection action for the subscriber (SdkReconnectableAdapter returns empty), so on a sustained connectivity loss it falls back to a generic stop+start that can leave consumption permanently stopped until the app is restarted — the failure seen in the May 7 us-east-1 incident (W-22472649).

      Tears the current subscriber down and rebuilds it against a freshly resolved destination. On success the runtime resumes delivery; on failure it applies the configured reconnection strategy.

      Specified by:
      reconnect in interface org.mule.runtime.extension.api.runtime.connectivity.Reconnectable
    • onStop

      public void onStop()
      Specified by:
      onStop in class org.mule.runtime.extension.api.runtime.source.Source<InputStream,AnypointMQMessageAttributes>
    • onSuccess

      @OnSuccess public void onSuccess(org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext) throws Exception
      Throws:
      Exception
    • onError

      @OnError public void onError(org.mule.runtime.api.message.Error error, org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext)