MessageService
The MessageService is a message-based data transmission system in which producers of messages have them transported via so-called message queues to any existing subscribers, where they can be processed. Messages can also be sent across multiple Integration Servers by defining so-called routes.
XML Configuration
Note: If you want to modify the configuration file for a service directly in the file system, you will find the appropriate file in the configuration file ./etc/factory.xml. Details about the configuration can be found in the respective documentation of a service. Otherwise, you can edit the configuration file directly via the respective service in the GUI.
The following XML fragment with all possible basic settings can be used to configure the MessageService.
<
Set
name
=
"defaultWaitTime"
>600000</
Set
>
<
Set
name
=
"queueInterval"
>50</
Set
>
The parameters have the following meaning.
Parameter |
Description |
defaultWaitTime |
The maximum time (in milliseconds) that a message will be held by the MessageService before it is discarded. When changed, it is valid for all subsequent messages. |
queueInterval |
The time to wait (in milliseconds) before undelivered asynchronous persistent messages are resent. |
The following XML fragment adds a ConsumerQueue to the MessageService.
<
Call
name
=
"addConsumerQueue"
>
<
Arg
>
<
New
class
=
"com.ebd.hub.services.message.ConsumerQueue"
>
<
Arg
>Context</
Arg
>
<
Arg
>Queue</
Arg
>
[possibly adding consumers]
</
New
>
</
Arg
>
</
Call
>
Adding a Consumer to a ConsumerQueue
The following XML fragment adds a Consumer to a ConsumerQueue.
<
Call
name
=
"addConsumer"
>
<
Arg
>classname</
Arg
>
<
Arg
>methodname</
Arg
>
</
Call
>
This fragment must be inserted instead of the placeholder, which can be seen in the ConsumerQueue above. classname is the class name of the class to act as consumer, methodname is the method to call in this class.
Activating the RemoteInterface
This option enables the remote interface through which remote Integration Servers can deliver messages for which there was no local subscriber. The following XML fragment activates the remote interface.
<
Call
name
=
"enableRemoteInterface"
>
<
Arg
>IP address</
Arg
>
<
Arg
type
=
"int"
>port</
Arg
>
</
Call
>
IP address is the IP address of the interface to which the reception should be restricted, or 0.0.0.0, if no such restriction should exist.
Adding a Route
The following XML fragment adds a Route to a specific ConsumerQueue.
<
Call
name
=
"addRoute"
>
<
Arg
>Context</
Arg
>
<
Arg
>Queue</
Arg
>
<
Arg
>
<
New
class
=
"com.ebd.hub.services.message.Target"
>
<
Arg
>hostname</
Arg
>
<
Arg
type
=
"int"
>port</
Arg
>
</
New
>
</
Arg
>
</
Call
>
The parameters have the following meaning.
Parameter |
Description |
context |
The name of the message context. |
queue |
The name of the message queue. |
hostname |
The host name of the RemoteInterface. |
port |
The port of the RemoteInterface. |
General Settings
(1) Activating the remote interface.
(2) Number of threads for processing messages.
(3) Corresponds to the XML parameter defaultWaitTime. This is the time that the message is held by the MessageService before it is discarded.
(4) Corresponds to the XML parameter queueInterval and is the time to wait to resend undelivered, asynchronous, persistent messages.
Routing Definitions
(1) The list of RemoteInterfaces. Entries can be added, edited and removed via the context menu. See (2),
(2) Protocol, host name (or IP address) and port of the RemoteInterface.
Defined Consumer Queues
(1) List of the defined ConsumerQueues. The display shows context, queue, number of consumers, the existence of a route definition and the number of messages that still have to be processed. An entry can be added, removed and edited via the context menu.
Modifying Consumer Queue
(1) Context name and queue name.
(2) Use the context menu to remove and add a consumer.
(3) Use the context menu to remove and add routing definitions.
Log Level Dependencies
Changes to the log level of the LogService have no influence on the logging behaviour of the MessageService.
If the service is set to verbose mode, the following additional logging steps are performed.
When a message is sent.
When establishing a connection via the RemoteInterface, the fact itself and the IP address of the request are recorded, regardless of whether a message is actually received or not.
When receiving a message via the RemoteInterface. Information about the event itself and additional information, such as the number of received bytes, etc. are logged.
When adding a message to a message queue.