public class BufferedMonitoredMessagingFactory extends java.lang.Object implements IMessagingSystemFactory
// Create TCP messaging system.
IMessagingSystemFactory anUnderlyingMessaging = new TcpMessagingSystemFactory();
// Create buffered monitored messaging which takes TCP as underlying messaging.
IMessagingSystemFactory aMessaging = new BufferedMonitoredMessagingFactory(anUnderlyingMessaging);
// Then creating channels which can be then attached to communication components.
IDuplexInputChannel anInputChannel = aMessaging.createDuplexInputChannel("tcp://127.0.0.1:8095/");
IDuplexInputChannel anOutputChannel = aMessaging.createDuplexOutputChannel("tcp://127.0.0.1:8095/");
Constructor and Description |
---|
BufferedMonitoredMessagingFactory(IMessagingSystemFactory underlyingMessaging)
Constructs the factory with default settings.
|
BufferedMonitoredMessagingFactory(IMessagingSystemFactory underlyingMessaging,
long maxOfflineTime,
long pingFrequency,
long pingResponseTimeout)
Constructs the factory with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
IDuplexInputChannel |
createDuplexInputChannel(java.lang.String channelId)
Creates the input channel which can receive and send messages.
|
IDuplexOutputChannel |
createDuplexOutputChannel(java.lang.String channelId)
Creates the output channel which can send and receive messages.
|
IDuplexOutputChannel |
createDuplexOutputChannel(java.lang.String channelId,
java.lang.String responseReceiverId)
Creates the output channel which can send and receive messages.
|
BufferedMessagingFactory |
getBufferedMessaging()
Returns underlying buffered messaging.
|
MonitoredMessagingFactory |
getMonitoredMessaging()
Returns underlying monitored messaging.
|
public BufferedMonitoredMessagingFactory(IMessagingSystemFactory underlyingMessaging)
underlyingMessaging
- underlying messaging system e.g. TCP, ...public BufferedMonitoredMessagingFactory(IMessagingSystemFactory underlyingMessaging, long maxOfflineTime, long pingFrequency, long pingResponseTimeout)
underlyingMessaging
- underlying messaging system e.g. TCP, ...maxOfflineTime
- the maximum time, the messaging can work offline. When the messaging works offline,
the sent messages are buffered and the connection is being reopened. If the connection is
not reopen within maxOfflineTime, the connection is closed.pingFrequency
- how often the connection is checked with the 'ping' requests.pingResponseTimeout
- the maximum time, the response for the 'ping' is expected.public IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId) throws java.lang.Exception
createDuplexOutputChannel
in interface IMessagingSystemFactory
channelId
- address of the input channel.java.lang.Exception
public IDuplexOutputChannel createDuplexOutputChannel(java.lang.String channelId, java.lang.String responseReceiverId) throws java.lang.Exception
createDuplexOutputChannel
in interface IMessagingSystemFactory
channelId
- address of the input channel.responseReceiverId
- unique identifier of the output channel. If the value is null then the identifier is genearated automaticallyjava.lang.Exception
public IDuplexInputChannel createDuplexInputChannel(java.lang.String channelId) throws java.lang.Exception
createDuplexInputChannel
in interface IMessagingSystemFactory
channelId
- address of the input channel.java.lang.Exception
public BufferedMessagingFactory getBufferedMessaging()
public MonitoredMessagingFactory getMonitoredMessaging()