Package com.attivio.client
Class MessageForwardingClient
- java.lang.Object
-
- com.attivio.client.AbstractReceiverClient
-
- com.attivio.client.MessageForwardingClient
-
public class MessageForwardingClient extends AbstractReceiverClient
Client that can be used to send arbitrary messages to any Attivio component by name.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.client.AbstractReceiverClient
AbstractReceiverClient.ClientMessageSender
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_COMPONENT_NAME
The property name to store the component name under.static java.lang.String
PROP_SYNCHRONOUS
The property name to store the synchronous flag under.-
Fields inherited from class com.attivio.client.AbstractReceiverClient
log
-
-
Constructor Summary
Constructors Constructor Description MessageForwardingClient(java.lang.String receiverUri)
Creates an AttivioMessageClient client which communicates with a message receiver at the specified URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
disconnect()
Deprecated.no longer necessaryMessageList
prepareMessageForTransmission(java.lang.String componentName, PlatformMessage msg, boolean synchronous)
Prepares the message to be sent to the MessageService.void
sendAsyncMessage(java.lang.String componentName, PlatformMessage msg)
Sends a message to a component name asynchronously.PlatformMessage
sendMessage(java.lang.String componentName, PlatformMessage msg)
Sends a message to a component name synchronously.-
Methods inherited from class com.attivio.client.AbstractReceiverClient
clearConnectionCredentials, getClientId, getClientWorkflow, getMessageSender, getReceiverUri, handleServerReset, isReceiverSSL, sendAsyncMessage, sendMessage, sendMessage, setClientWorkflow, setClientWorkflow, setConnectionCredentials, setMessageSender
-
-
-
-
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 namemsg
- 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 namemsg
- 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 tomsg
-synchronous
- true if the message will be sent synchronously.- Returns:
- a message ready to be transmitted to the MessageService
-
disconnect
@Deprecated public void disconnect() throws AttivioException
Deprecated.no longer necessaryno op.- Throws:
AttivioException
-
-