이 콘텐츠는 선택한 언어로 제공되지 않습니다.

12.4. Map Client Connections to Broker Instances


Map Client Connections to Broker Instances

The MQ Gateway includes a configuration PID, io.fabric8.gateway.detecting. It sets the following properties:
 # configures the protocol detecting gateway
port=61616
httpEnabled=true
openWireEnabled=true
stompEnabled=true
mqttEnabled=true
amqpEnabled=true
sslEnabled=false

defaultVirtualHost=default
zooKeeperPath=/fabric/registry/clusters/amq

loadBalancerType=roundrobin
stickyLoadBalancerCacheSize=10000
The defaultVirtualHost setting is used to specify the broker group name to be used by default for all clients. For example, if you have a Fabric broker group called us-east, with one or more broker instances running under this group (created using mq-create -group us-east). You can configure defaultVirtualHost to be us-east using the setting defaultVirtualHost=us-east.

How to Connect to a Specific Broker on the MQ Gateway

You can map to a broker group other than the default specified in defaultVirtualHost.
For example, if you had a broker group called us-west, set up in the same way as us-east above, you can map directly to it by configuring the MQ Gateway in the following way:
  1. Set up the Fabric broker group us-west using mq-create -group us-west
  2. Add the Fabric broker group name us-west as a virtual hostname for the machine that runs your MQ Gateway. This will require proper DNS configuration so that this virtual hostname can be resolved by any client.
  3. When your broker clients contact the MQ Gateway, use the hostname us-west in the broker url. For example,
    tcp://us-west:61616
The Gateway will map the request it receives via the virtual hostname us-west to one of your broker instances in the broker group us-west.
An alternative approach to that shown above is to define multiple instances of MQ Gateway. Configure each instance to a different default broker group in defaultVirtualHost and have broker clients explicitly connect to the instance of MQ Gateway that will bridge clients to the specific broker group.
For OpenWire only, you can use the following parameter to specify which broker group you want to be connected to:
?wireFormat.host=groupname
If this command parameter is not specified, then the request is directed to the value in defaultVirtualHost.

MQ Gateway Client Connections for For Openwire and STOMP

An MQ Gateway can have its services exposed over multiple host names. When it receives a connection request, it uses the host the client was trying to connect to to look up a broker fabric group by the same name. The client is then connected to one of the brokers in the group that supports the protocol the client is connecting with. If the host the client is trying to connect to cannot be determined or does not match any of the fabric broker groups, then the client will be connected to a broker group that matches the defaultVirtualHost configuration.
AMQP and MQTT connections do not pass the hostname information so they always connect to the broker group that matches the defaultVirtualHost configuration.

Using MQ Gateway with SSL/HTTPS

The HTTP gateway does not directly support SSL/HTTPS, but the MQ Gateway does. If MQ Gateway is deployed alongside the HTTP Gateway, it will re-direct the decrypted http traffic to the HTTP Gateway.
Configuration changes need to be made to accommodate SSL/HTTPS. Edit io.fabric8.gateway.detecting to change the following properties:
sslEnabled=true
trustStoreURL must be configured along with trustStorePassword
keyStoreURL must be configured along with keyStorePassword
keyAlias
keyPassword
You can also optionally configure the following properties:
sslProtocol,
sslStoreType,
sslAlgorithm,
enabledCipherSuites,
disabledCypherSuites

Change the Listening Port on MQ Gateway

To change the listening port on MQ Gateway, edit io.fabric8.gateway.detecting using the following command:
profile-edit --pid io.fabric8.gateway.detecting/port=61619 gateway-mq  or
   gateway_mq profile -> configurations -> Detecting Gateway -> Bind Port on
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.