Class MessageForwardingClient


  • public class MessageForwardingClient
    extends AbstractReceiverClient
    Client that can be used to send arbitrary messages to any Attivio component by name.
    • Field Detail

      • PROP_SYNCHRONOUS

        public static final java.lang.String PROP_SYNCHRONOUS
        The property name to store the synchronous flag under.
        See Also:
        Constant Field Values
      • PROP_COMPONENT_NAME

        public static final java.lang.String PROP_COMPONENT_NAME
        The property name to store the component name under.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageForwardingClient

        public MessageForwardingClient​(java.lang.String receiverUri)
                                throws AttivioException
        Creates an AttivioMessageClient client which communicates with a message receiver at the specified URI.
        Parameters:
        receiverUri - the receiver URI
        Throws:
        AttivioException
    • Method Detail

      • sendAsyncMessage

        public void sendAsyncMessage​(java.lang.String componentName,
                                     PlatformMessage msg)
                              throws AttivioException
        Sends a message to a component name asynchronously.

        In general this method should return immediately, however this method may block if the underlying component pool is currently backing off new requests are configured via the pooling and threading profiles of the system and component.

        Parameters:
        componentName - the component name
        msg - the message to send
        Throws:
        AttivioException
      • sendMessage

        public PlatformMessage sendMessage​(java.lang.String componentName,
                                           PlatformMessage msg)
                                    throws AttivioException
        Sends a message to a component name synchronously.

        This method will block until the message has been sent, processed, and a result it returned.

        Parameters:
        componentName - the component name
        msg - the message to send
        Throws:
        AttivioException
      • prepareMessageForTransmission

        public MessageList prepareMessageForTransmission​(java.lang.String componentName,
                                                         PlatformMessage msg,
                                                         boolean synchronous)
        Prepares the message to be sent to the MessageService.
        Parameters:
        componentName - the component to forward the message to
        msg -
        synchronous - true if the message will be sent synchronously.
        Returns:
        a message ready to be transmitted to the MessageService