-
Understand the concepts of AMQ Online
-
How to use AMQ Online
AMQ Online is a solution (Operator) to manage multiple components to provide the over all functionality of running self-service (Messaging as a Service) messaging platform on OpenShift
-
AMQ Broker :
-
AMQ Broker is a full-featured, message-oriented middleware broker. It offers advanced addressing and queueing, fast message persistence, and high availability. AMQ Broker supports multiple protocols and operating environments, enabling you to use your existing assets.
-
This is where all your brokers hosted and it is responsible for persisting messages.
-
-
AMQ Interconnect :
-
AMQ Interconnect provides flexible routing of messages between AMQP-enabled endpoints, including clients, brokers, and standalone services. With a single connection into a network of AMQ Interconnect routers, a client can exchange messages with any other endpoint connected to the network.
-
This is where all your routes hosted (it will come later when explaining address).
-
Tip
|
For more information regarding different AMQ separate products, please refer to https://access.redhat.com/documentation/en-us/red_hat_amq/7.5/html/introducing_red_hat_amq_7/components#broker |
-
keycloak :
-
Open Source Identity and Access Management, which is used to host access control information for queues, topic,etc.
-
After installing AMQ Online it defines new types (CRDs) which we will try to briefly explain them.
Describes an authentication service instance used to authenticate massaging clients. This is simply your way to configure keycloak server itself.
Describes the messaging resources available for address spaces (will come later) using this plan (so it an aggregate of all AddressPlan), such as the available address plans and the amount of router and broker resources that can be used. Think of it like the main quota control, it knows how much hardware can be used by referring to infrastructure configuration. [IMPORTANT] It Defines the infrastructure to be deployed, and as it’s name depicts "plan" it define quota restrictions (i.e., maximum number of addresses)
Describes the messaging resources consumed by a particular address using this plan, such as what fraction of routers and brokers an address will use and other properties that should be set for multiple addresses.
as name suggested, it configures the hardware resource allocated to the components, such as CPU. memory, storage of console, broker and router, also some other specific config too. it mainly two types;
This will allow you to host both AMQ Brokers, and AMQ Interconnect routes
Defines semantics of address, Has set of properties
-
Available address types determined by the address space type
-
Available plans determined by the address type
-
Address Space - refer back to AddressSpacePlan and here the magic happen as it go and create AMQ broker pod and AMQ Interconnect Pod base on the type (standard or brokered), also it like them with keycloak (AuthenticationService) as authentication/authorization source, and do all needed configuration .
-
Address - the destinations which use the spinned pods from AddressSpace to configure broker or routers.
-
Message User - defines the authentication/authorization attributes (which user can do what) for destination (like queue or topic). It mainly go and write the rules to keycloak.
Important
|
|
There are two main roles in AMQ Online;
Admin does the installation of the platform foundation on OpenShift, they install all the basic elements that controls all the needed brokers, routers, user console and monitoring tools, and also takes care of setting up the authentication and authorization of who has access to the platform. We don’t always have unlimited computing resource for all users, admin also has control over the resource limitation and create different plans that can apply to accompany different needs from users.
They are the users of the platform, they will be creating "Address Space", and create destinations by applying the plans on top of it. After the queue and topics are created, the tenants can go ahead and create credentials maps (MessagingUser) to different access roles, they can decide what account has access to admin console, which account has consume/produce right to any addresses(queues/ topics) in the Address Space. Please note, tenants will have no visibility to queue or topics of other Address Space, unless specially specified. Once the address are created and config correctly, application will be able to use the credential to read/write to the messaging address.
So A typical workflow will be;
-
Admins install AMQ online from Operator Hub or install it manually
-
Admins will create needed objects in amq-online namespace
-
Define AuthenticationService(s)
-
Define StandardInfraConfig(s) Or BrokeredInfraConfig(s)
-
Define AddressSpacePlan
-
Define AddressPlan
-
-
Each Tenant will create needed objects in his own namespace
-
Define AddressSpace
-
Define Address
-
Define MessageUser
-
Important
|
Each application owner will create separate Address and AddressSapce in their namespace utilizing what Administrators created as infra objects. |
Feature | Brokered address space | Standard address space | |
---|---|---|---|
Address type |
Queue |
Yes |
Yes |
Topic |
Yes |
Yes |
|
Multicast |
No |
Yes |
|
Anycast |
No |
Yes |
|
Subscription |
No |
Yes |
|
Messaging protocol |
AMQP |
Yes |
Yes |
MQTT |
Yes |
Technology preview only |
|
CORE |
Yes |
No |
|
OpenWire |
Yes |
No |
|
STOMP |
Yes |
No |
|
Transports |
TCP |
Yes |
Yes |
WebSocket |
Yes |
Yes |
|
Durable subscriptions |
JMS durable subscriptions |
Yes |
No |
"Named" durable subscriptions |
No |
Yes |
|
JMS |
Transaction support |
Yes |
No |
Selectors on queues |
Yes |
No |
|
Message ordering guarantees (including prioritization) |
Yes |
No |
|
Scalability |
Scalable distributed queues and topics |
No |
Yes |
There are two ways for installing AMQ online.
-
Using the source files for RedHat portal.
-
Using the AMQ online operator from OperatorHub.
-
For ease of use i created a oc cli script which effectively use OperatorHub for installation install_amq_online.sh.
-
There are multiple JMS Clients depending on the underlying Messaging Protocol (as shown in above table) each one have a set features and may have also some limitations.
-
Messaging Protocol
-
AMQP: AMQP JMS client provides full AMQP 1.0 support and works with any AMQ server.
AMQ AMQP JMS is a Java Message Service (JMS) 2.0 client for use in messaging applications that send and receive AMQP messages.
-
Key features
-
JMS 1.1 and 2.0 compatible
-
SSL/TLS for secure communication
-
Flexible SASL authentication
-
Automatic reconnect and failover
-
Distributed tracing based on the OpenTracing standard
-
Ready for use with OSGi containers
-
Pure-Java implementation
-
-
Procedure
-
Add the Red Hat repository to your Maven settings or POM file. For example configuration files, see Section B.1, “Using the online repository”.
<repository> <id>red-hat-ga</id> <url>https://maven.repository.redhat.com/ga</url> </repository>
-
Add the client dependency to your POM file.
<dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-jms-client</artifactId> <version>0.45.0.redhat-00002</version> </dependency>
The client library is now available in your Maven project.
ImportantImportant Note on AMQ JMS client for AMQPAMQ JMS does not currently support distributed transactions (XA). If your application requires distributed transactions, it is recommended that you use the AMQ Core Protocol JMS client.
-
-
-
OPENWIRE: OPENWIRE JMS CLIENT
AMQ OpenWire JMS is a Java Message Service (JMS) 1.1 client for use in messaging applications that send and receive OpenWire messages. To support existing applications based on A-MQ 6
-
Key features
-
JMS 1.1 compatible
-
SSL/TLS for secure communication
-
Automatic reconnect and failover
-
Distributed transactions (XA)
-
Pure-Java implementation
-
-
Procedure
-
Add the Red Hat repository to your Maven settings or POM file. For example configuration files, see Section B.1, “Using the online repository”.
<repository> <id>red-hat-ga</id> <url>https://maven.repository.redhat.com/ga</url> </repository>
-
Add the library dependency to your POM file.
<dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-client</artifactId> <version>5.11.0.redhat-630329</version> </dependency>
The client is now available in your Maven project.
-
-
-
CORE: AMQ Core Protocol JMS is a Java Message Service (JMS) 2.0 client for use in messaging applications that send and receive Artemis Core Protocol messages. Artemis core is a messaging system with its own API.
-
Key features
-
JMS 1.1 and 2.0 compatible
-
SSL/TLS for secure communication
-
Automatic reconnect and failover
-
Distributed transactions (XA)
-
Pure-Java implementation
-
-
Procedure
-
Add the Red Hat repository to your Maven settings or POM file.
<repository> <id>red-hat-ga</id> <url>https://maven.repository.redhat.com/ga</url> </repository>
-
Add the library dependency to your POM file.
<dependency> <groupId>org.apache.activemq</groupId> <artifactId>artemis-jms-client</artifactId> <version>2.9.0.redhat-00002</version> </dependency>
The client is now available in your Maven project.
-
-
-