Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 6. ActiveMQ Brokers and Clusters
Abstract
Fabric provides predefined profiles for deploying a simple standalone broker and, in addition, you can use the powerful
fabric:mq-create command to create and deploy clusters of brokers.
6.1. Creating a Standalone Broker Instance 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
MQ profiles 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following profiles are important for creating broker instances:
mq-base- An abstract profile, which defines some important properties and resources for the broker, but should never be used directly to instantiate a broker.
mq-default- A basic standalone broker, which inherits most of its properties from the
mq-baseprofile.
To examine the properties defined in these profiles, you can invoke the
fabric:profile-display command, as follows:
JBossFuse:karaf@root> fabric:profile-display mq-default ... JBossFuse:karaf@root> fabric:profile-display mq-base ...
JBossFuse:karaf@root> fabric:profile-display mq-default
...
JBossFuse:karaf@root> fabric:profile-display mq-base
...
Creating a new broker instance 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
A Fuse MQ broker is a Karaf container instance running a message broker profile. The profile defines the broker dependencies (through features) and the configuration for the broker. The simplest approach to creating a new broker is to use the provided
mq-default profile.
For example, to create a new
mq-default broker instance called broker1, enter the following console command:
JBossFuse:karaf@root>fabric:container-create-child --profile mq-default root broker1
The following containers have been created successfully:
broker1
JBossFuse:karaf@root>fabric:container-create-child --profile mq-default root broker1
The following containers have been created successfully:
broker1
This command creates a new container called
broker1 with a broker of the same name running on it.
fabric:mq-create command 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The
fabric:mq-create command provides a short cut to creating a broker, but with more flexibility, because it also creates a new profile. To create a new broker instance called brokerx using fabric:mq-create, enter the following console command:
JBossFuse:karaf@root> fabric:mq-create --create-container broker --replicas 1 brokerx MQ profile mq-broker-default.brokerx ready
JBossFuse:karaf@root> fabric:mq-create --create-container broker --replicas 1 brokerx
MQ profile mq-broker-default.brokerx ready
Just like the basic
fabric:container-create-child command, fabric:mq-create creates a container called broker1 and runs a broker instance on it. There are some differences, however:
- The new
broker1container is implicitly created as a child of the current container, - The new broker has its own profile,
mq-broker-default.brokerx, which is based on themq-baseprofile template, - It is possible to edit the
mq-broker-default.brokerxprofile, to customize the configuration of this new broker. - The
--replicasoption lets you specify the number of master/slave broker replicas (for more details, see Section 6.3.2, “Master-Slave Cluster”). In this example, we specify one replica (the default is two).
Note
The new profile gets the name
mq-broker-Group.BrokerName by default. If you want the profile to have the same name as the broker (which was the default in JBoss Fuse version 6.0), you can specify the profile name explicitly using the --profile option.
Starting a broker on an existing container 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The
fabric:mq-create command can be used to deploy brokers on existing containers. Consider the following example, which creates a new Fuse MQ broker in two steps:
The preceding example firstly creates a default child container, and then creates and deploys the new
mq-broker-default.brokerx profile to the container, by invoking fabric:mq-create with the --assign-container option. Of course, instead of deploying to a local child container (as in this example), we could assign the broker to an SSH container or a cloud container.
Broker groups 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Brokers created using the
fabric:mq-create command are always registered with a specific broker group. If you do not specify the group name explicitly at the time you create the broker, the broker gets registered with the default group by default.
If you like, you can specify the group name explicitly using the
--group option of the fabric:mq-create command. For example, to create a new broker that registers with the west-coast group, enter the following console command:
JBossFuse:karaf@root> fabric:mq-create --create-container broker --replicas 1 --group west-coast brokery MQ profile mq-broker-default.brokery ready
JBossFuse:karaf@root> fabric:mq-create --create-container broker --replicas 1 --group west-coast brokery
MQ profile mq-broker-default.brokery ready
If the
west-coast group does not exist prior to running this command, it is automatically created by Fabric. Broker groups are important for defining clusters of brokers, providing the underlying mechanism for creating load-balancing clusters and master-slave clusters. For details, see Section 6.3, “Topologies”.