Skip to content
assimbly edited this page May 20, 2022 · 5 revisions

What is a broker gateway?

A message broker is software that enables applications, systems, and services to communicate with each other and exchange information. These applications, systems or services send or receive messages to queues or topics.

A queue is sequence of messages. Those messages can be received by only one consumer. In a topic every consumer (subscriber) receives a copy of the message. The broker manages those queues and topics.

Queue

A broker gateway means that the broker acts as gateway for a specific application. Several applications can send or receive messages to the broker while the application uses the broker as a gateway.

Assimbly can run brokers embedded. This means applications can send or receive messages directly to the broker on Assimbly or use an Assimbly flow to get or put messages on the broker.

Why a broker gateway?

A broker has several advantages.

  1. Transport layer. An application only needs to implement this protocol and don't care about others. There is a single layer of transport. Applications don't need to be connected directly, but use the broker as intermediary layer.
  2. Delivery guarantees: Messages are transported in a reliable way. With for example file systems or FTP a message can be deleted from the file system or locked by the file system.
  3. Scaling: Brokers normally scale well even though data volumes changes.
  4. Buffering: In case of high volumes it buffers messages, so that consumers don't need to scaled for peak volumes.
  5. Security: Control the way systems/users can send or receive messages.

See also: message-queues-12-reasons

ActiveMQ Classic or ActiveMQ Artemis

Assimbly supports two brokers: ActiveMQ Classic and ActiveMQ Artemis. Both are supported well in Assimbly flows. Use ActiveMQ if you need a stable and well documented broker. Use Artemis if performance and cloud are more important. Artemis is expected to become the new version of ActiveMQ and used by default in Assimbly.

How to use brokers

To enable the brokers

  1. Navigate to "Settings --> Gateway"
  2. Click on edit and choose "Broker" (ActiveMQ Classic) or "Artemis" (ActiveMQ Artemis). The broker now start automatically.
  3. To send messages to the broker create a new flow and use the ActiveMQ component. For Artemis use the SJMS component.

To view messages on the broker you can use "Queues" or "Topics" page. You can also use JMSToolbox. This is a universal broker client.

By default Assimbly starts with a simple broker configuration that is reachable on "tcp://localhost:61616". There is no security enabled, you can immediately send or receive messages. When sending messages queues or topics are automatically created.

Broker clients

You can create an Assimbly flow to act as a client and send/receive messages from queues. Example is done in the following tutorial.

It's also possible to use an external client. A common client is JMSToolbox, a universal JMS client. It can be used to view queues and send messages to it. To use it:

CreateJMSToolboxConnection

Save the connection

By double-clicking on the name it will connect to the broker.

Brokers on production

To create a configuration for production use, you need to add a configuration file to the application directory (where the jar starts).

  • The configuration file for the default broker is "activemq.xml". An example is here:

https://github.com/assimbly/gateway/blob/master/activemq.xml

Complete reference is on the ActiveMQ website:

https://activemq.apache.org/version-5-xml-configuration.html

  • The configuration file for Artemis is "broker.xml". An example is here:

https://github.com/assimbly/gateway/blob/master/broker.xml

Complete reference is on the ActiveMQ website:

https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html

Clustered broker

Mostly on production the broker has several nodes. Together these nodes form a cluster. Read more:

How to set up a cluster broker?

Clone this wiki locally