The Gateway provides a service for discovery, load balancing and failover of services running within a Fabric8. For messaging clients with A-MQ using any protocol (OpenWire, STOMP, MQTT, AMQP or WebSockets) they can discover and connect to the right broker letting the gateway deal connection management and proxy requests to where the services are actually running. See more information on the official documnetation
- [MQ Gateway documentation] (http://fabric8.io/gitbook/gateway.html)
This simple example deploys a Standalone AMQ broker and a default MQ Gateway. The MQ Gateway listens on 61616 port and is able to detect protocol and proxy every request on the real services. To test the gateway you can use any Openwire, MQTT, STOMP or AMQP client and point it to 61616 port. In the example boh a STOMP ruby client and an OpenWire one are provided.
- Clone this repo
- Build and install example into your local maven repo
$ mvn clean install
- Launch JBoss Fuse ESB
$ $FUSE_HOME/bin/start
$ $FUSE_HOME/bin/client
- Run Karaf installer from Karaf console
shell:source mvn:it.redhat.quickstarts.mqgateway/installer/1.0-SNAPSHOT/karaf/installer
- Wait for containers to successfully provision
- Go in the stomptest directory and run in two different terminals the ruby stompcat client
- Run the STOMP ruby producer
$ cat | ./catstomp
- Run the STOMP ruby consumer
$ stompcat
- type a message in the STOMP producer and observe the STOMP consumer.
- Use hawt.io to observe the Gateway detecting the protocol and redirecting the traffic to the proper endpoint
- If you want to test OpenWire too, go in the openwiretest directory.
You may have to modify the AMQ_HOME variable to point to your installation,
export AMQ_HOME=/path/to/your/amq
- Run in two different terminals
$ consumer.sh
$ producer.sh
- [James Rawlings fuse example] (https://github.com/rawlingsj/fuse-fabric-mq-example)