Class VMRouter

java.lang.Object
com.mirth.connect.server.userutil.VMRouter

public class VMRouter extends Object
Utility class used to dispatch messages to channels.
  • Constructor Details

    • VMRouter

      public VMRouter()
      Instantiates a VMRouter object.
  • Method Details

    • routeMessage

      public Response routeMessage(String channelName, String message)
      Dispatches a message to a channel, specified by the deployed channel name. If the dispatch fails for any reason (for example, if the target channel is not started), a Response object with the ERROR status and the error message will be returned.
      Parameters:
      channelName - The name of the deployed channel to dispatch the message to.
      message - The message to dispatch to the channel.
      Returns:
      The Response object returned by the channel, if its source connector is configured to return one.
    • routeMessage

      public Response routeMessage(String channelName, RawMessage rawMessage)
      Dispatches a message to a channel, specified by the deployed channel name. If the dispatch fails for any reason (for example, if the target channel is not started), a Response object with the ERROR status and the error message will be returned.
      Parameters:
      channelName - The name of the deployed channel to dispatch the message to.
      rawMessage - A RawMessage object to dispatch to the channel.
      Returns:
      The Response object returned by the channel, if its source connector is configured to return one.
    • routeMessageByChannelId

      public Response routeMessageByChannelId(String channelId, String message)
      Dispatches a message to a channel, specified by the deployed channel ID. If the dispatch fails for any reason (for example, if the target channel is not started), a Response object with the ERROR status and the error message will be returned.
      Parameters:
      channelId - The ID of the deployed channel to dispatch the message to.
      message - The message to dispatch to the channel.
      Returns:
      The Response object returned by the channel, if its source connector is configured to return one.
    • routeMessageByChannelId

      public Response routeMessageByChannelId(String channelId, RawMessage rawMessage)
      Dispatches a message to a channel, specified by the deployed channel ID. If the dispatch fails for any reason (for example, if the target channel is not started), a Response object with the ERROR status and the error message will be returned.
      Parameters:
      channelId - The ID of the deployed channel to dispatch the message to.
      rawMessage - A RawMessage object to dispatch to the channel.
      Returns:
      The Response object returned by the channel, if its source connector is configured to return one.