Sometime ago I posted a blog about achieve fault tolerant messaging, in the article I mention using the fabric registry discovery to hide all the IP address and port detail in the client side. With new Fuse 6.2 you will not be able to find this anymore.  So how do we achieve fault tolerant messaging in the new Fuse?

In JBoss Fuse 6.2, we can do it by starting up a MQ Gateway. What it does is it provides a single IP and port to accept connections from clients.  All the individual IPs and Port of the broker are hidden away tothe client, the client only needs to know the IP and port of the MQ Gateway (Default Port: 61616). The gateway will discover all the brokers in the fabric, and no matter what the incoming protocol is, it can be OpenWire, MQTT, STOMP and AMQP. The gateway will see which broker is available in the host specified for the protocol, and connect the client to the broker. If multiple brokers are available in the host group, gateway can dispatch request to them, by this we can achieve load balance. There are 3 different way to do load balance, Random, Round Robin and Sticky.

If any thing goes wrong with the broker a client is connecting, and got disconnected, the gateway will look for another available broker in the group. This gives you high availability to your service.

To startup a MQ Gateway, simply choose the gateway-mq profile to the container.

It will automatically find brokers in fabric, 



I updated my failover demo instead of using fabric registry discovery, I change my application and connect it to MQ Gateway.  In this demo, you will first need to create a broker failoverMS, choose Master/Slave type and use blogdemo as Group.





Click on the red triangle to start provision the brokers. It will take you yo the page to create container for the broker profile.


And will start create number of container you specified in the configuration.


Then we can startup the MQ-Gateway, before we do that, go to the gateway-mq profile and edit the io.fabric8.gateway.detecting.properties file. Change port to 8888 and defaultVirtualHost to blogdemo.



And add the gateway-mq profile to a container, as previously stated.
Let's take a look at the client application, it's written with Camel. Look at the configurations in the Camel route, here you see no matter if it's an OpenWire or MQTT protocol, it is set to tcp://localhost:8888, which is the IP and port of MQ Gateway.

This application send a message to the broker, through OpenWire and MQTT protocol every 5 secs. Deploy the profile "" to a new container.



Go to container console of testcon, you will find the camel routes are running



In the MQ Gateway, you can see the request was dispatched to the broker we have created.
And the messages was sent to broker.






Video can be found here.


The application code can be found here.
https://github.com/jbossdemocentral/jboss-fuse-mqgateway-failoverdemo

Enjoy!
1

View comments

  1. Are you looking for a business loan, personal loans, mortgage loans, car loans, student loans, unsecured consolidation loans,project funding etc ... Or simply refuse loan from a bank or financial institution for one or more reasons? We are the right solutions for credit! We offer loans to businesses and individuals with low and affordable interest rate of 2%. So if you are Interested in an urgent and secured loan. For more information kindly email us today Via: elegantloanfirm@hotmail.com.



    ReplyDelete
Observability in Hybrid Multi-cloud environment
1
Overview of making Hybrid Multi-cloud GitOps works
Hybrid Multi-cloud dynamic security management
A study of hosting and managing on Hybrid Multi-cloud
1
Make SAP Cloud Native and Event Driven in 4 days
Make SAP Cloud Native and Event Driven in 4 days
Kamelet for streaming to Kafka!
1
Tooling guide for Getting Started with Apache Camel in 2021
2
Contract first development - the event driven way!
6
Serverless Integration Components
4
Six reasons why you will love Camel K
1
My2Cents - Eight things leads to developing catastrophic cloud native microservices system
4
AMQ Online 101 - What I've learnt from recent AMQ Online Hackfest
5
My 2cents on the future of Integration - With Service Mesh/Istio and Serverless/KNative
46
Fuse - Contract First API Design with Apicurio and Fuse/Camel - Part One
1
Red Hat Fuse 7 - Announcing Red Hat Fuse 7 GA!!
Red Hat Fuse - Announcing Fuse 7 Tech preview 3 release.
106
Red Hat Fuse - Tech Quickies series - Zero. Hello world
4
Organizing microservices - Modern Integration
3
Reference architecture of Agile Integration
1
The rise of Agile Integration, Integration is not DEAD nor LAME!
7
Red Hat JBoss Fuse - Applying API Best Practices in Fuse
Red Hat JBoss Fuse - Getting Started with Fuse Integration Service 2.0 Tech preview
4
Red Hat JBoss Fuse - Automate integration CI/CD processes
2
Red Hat JBoss Fuse/A-MQ - Fuse and A-MQ Version 6.3 GA is released!
43
Red Hat JBoss A-MQ - A-MQ 7 alpha is ready!
7
JBoss Fuse integration service - Enhancing Customer Experience Through Integration and Automation of Business Events in the Cloud
3
Red Hat JBoss Fuse - Healthcare integration demo Part Three
Red Hat JBoss Fuse - Healthcare integration demo Part Two
Red Hat JBoss Fuse - Healthcare integration demo Part One
5
Red Hat JBoss Fuse - The next step of integration for healthcare industry
Fuse Integration Service - Auto Dealership Management Demo, Part Six
Fuse Integration Service - Auto Dealership Management Demo, Part Five
1
Fuse Integration Service - Auto Dealership Management Demo, Part Four
Fuse Integration Service - Auto Dealership Management Demo, Part Three
1
Fuse Integration Service - Auto Dealership Management Demo, Part Two
Fuse Integration Service - Auto Dealership Management Demo, Part One
3
Fuse Integration Service - Setup JBDS and create first quickstart application
4
Fuse Integration Service- What is Fuse Integration Service?
Fuse Integration Service - Getting your Local Environment ready!
Red Hat JBoss Fuse - Switchyard in OSGi
1
Red Hat JBoss Fuse - Moving Camel application between OSGi and JavaEE containers
2
Red Hat JBoss Fuse - Comparing different ways of Developing Fuse Application
Red Hat JBoss Fuse - Comparing different ways of Developing Fuse Application
1
Red Hat JBoss Fuse - Fuse Management Console in EAP
2
Red Hat JBoss Fuse - Workshop 101 Fuse in EAP
Red Hat JBoss Fuse - Integrating Database, Java Bean and Restful Services in EAP, Java DSL with CDI
Red Hat JBoss Fuse - Integrating Database, Java Bean and Restful Services in EAP, Spring DSL
Red Hat JBoss Fuse - Integrating Database, Java Bean and Restful Services in EAP, XML route with JNDI
4
Red Hat JBoss Fuse - 3 ways to develop you Fuse application in JBoss EAP, Spring DSL
1
Red Hat JBoss Fuse - 3 ways to develop you Fuse application in JBoss EAP, Java DSL
Red Hat JBoss Fuse - 3 ways to develop you Fuse application in JBoss EAP, XML route with JNDI
JBoss Fuse - Make your JBoss EAP Fuse ready!
Webinar - The perfect match: Business processes and microservices
Webinar - The perfect match: Business processes and microservices
Red Hat JBoss Fuse - Deploy a WAR file with Servlet
Red Hat JBoss Fuse - Connecting to A-MQ in EAP with Camel
RHTE - Improve business process with microservice integration
Red Hat JBoss Fuse - Tools make your world go round, the demo
Red Hat JBoss Fuse - Tools make your world go round, the demo
2
Red Hat JBoss Fuse - Tools make your world go round, the slides and basics
Red Hat JBoss Fuse - Tools make your world go round, the slides and basics
RHTE - Supercharge your integration services
New top menu
Red Hat JBoss Fuse - Load Balance Quartz Cron Jobs
1
Red Hat JBoss Fuse - Tips, Driver not found in JBoss Fuse
6
Red Hat JBoss Fuse - Processes and Integration routes
Red Hat JBoss Fuse - Invoking Process in JBoss BPM Suite using CXF-RS Client in Fuse
JBoss Fuse - JBoss BPM Microservices Integration
1
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part7
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 6
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 6
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 5
2
Red Hat JBoss Fuse - When size and time does matter
Red Hat JBoss Fuse - When size and time does matter
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 3
2
Red Hat JBoss Fuse - Managing microservice architecture in JBoss Fuse
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 4
5
JBoss Fuse - Updates of Fuse 101 Labs
JBoss Fuse - Updates of Fuse 101 Labs
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 2
2
Red Hat JBoss Fuse - Getting Started Home Loan Demo version 6.2 Part 1
23
JBoss Fuse - Enterprise application architecture with JBoss Fuse and JBoss BPM suite
JBoss Fuse/A-MQ - Achieve fault tolerant messaging with MQ Gateway
1
JBoss Fuse - Tips, Deploying Profile without Fabric8 maven plugin
1
JBoss Fuse - Tips, Display Camel counter in Fuse 6.2
JBoss Fuse - What's new in JBoss Fuse 6.2
3
Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part Five
1
Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part Four
Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part Three
1
Red Hat JBoss xPaaS - When xPaaS meets DEVOPS - Part Five
1
Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part Two
2
Red Hat JBoss xPaaS - When xPaaS meets DEVOPS - Part Four
Integration Project- Micro Services Migration Story with JBoss BPM Travel Agency - Part One
5
JBoss Fuse - Automating your environment with Fuse CLI
1
Red Hat JBoss xPaaS - When xPaaS meets DEVOPS - Part Three
JBoss Fuse - JBoss Fuse or ETL?
9
Red Hat JBoss xPaaS - When xPaaS meets DEVOPS - Part Two
Red Hat JBoss xPaaS - When xPaaS meets DEVOPS - Part One
JBoss Fuse - Error Handling workshop
3
JBoss Fuse - Tips, Offline Repository in Fuse
JBoss Fuse - Fuse workshop 101 - Part Six
3
JBoss Fuse - House Keeping, where to download and what version of JBoss Fuse?
JBoss Fuse - Fuse workshop 101 - Part Five
3
JBoss Fuse - Fuse workshop 101 - Part Four
1
JBoss Fuse - Fuse workshop 101 - Part Three
JBoss Fuse - Fuse workshop 101 - Part Two
7
JBoss Fuse - Fuse workshop 101 - Part One
104
Popular Posts
Popular Posts
About Me
Archive 檔案室
Labels
Labels
Blog of My Friends
Blog of My Friends
Facebook Groups
Facebook Groups
Support a friend
Support a friend
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.