Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Integrate Red Hat Fuse 7 on Apache Karaf with Red Hat AMQ 7

June 2, 2021
Chandra Shekhar Pandey
Related topics:
APIsContainersJava
Related products:
Streams for Apache KafkaRed Hat Fuse

    In this article, I will demonstrate how to use Apache Camel applications in Red Hat Fuse 7.8 to produce and consume messages from Red Hat AMQ 7 or its upstream project, Apache ActiveMQ Artemis. This approach uses AMQ Core Protocol Java Message Service (JMS). Users who want to migrate from Red Hat Fuse 6 and Red Hat AMQ 6 to Red Hat Fuse 7 and Red Hat AMQ 7 will also find this tutorial helpful.

    Set up the ActiveMQ Artemis broker

    Here are the steps to set up the ActiveMQ Artemis broker:

    1. Download Apache Artemis. At the time of writing this article, apache-artemis-2.17.0-bin.zip is the latest version.
    2. Unzip this distribution. Create a folder called apache-artemis-2.17-instance in parallel to the unzipped folder, as shown in the following example:
      
      $ ls -ltr|grep artemis
      drwxr-xr-x. 7 chandrashekhar chandrashekhar 4096 Feb 11 12:21 apache-artemis-2.17.0
      -rw-r--r--. 1 chandrashekhar chandrashekhar 63489635 Apr 24 21:23 apache-artemis-2.17.0-bin.zip
      drwxr-xr-x. 2 chandrashekhar chandrashekhar 4096 Apr 24 21:26 apache-artemis-2.17-instance
      
      $ cd apache-artemis-2.17-instance
      
      $ ../apache-artemis-2.17.0/bin/artemis create artemis_instance_1 --user admin --password admin
      Creating ActiveMQ Artemis instance at: /mnt/79fece0c-d480-4c54-8268-eaf9ce6ba53d/Development_SSD/AMQ_RH/apache-artemis-2.17-instance/artemis_instance_1
      
      --allow-anonymous | --require-login: is a mandatory property!
      Allow anonymous access?, valid values are Y,N,True,False
      N
      
      Auto tuning journal ...
      done! Your system can make 62.5 writes per millisecond, your journal-buffer-timeout will be 16000
      
      You can now start the broker by executing:
      
      "/mnt/79fece0c-d480-4c54-8268-eaf9ce6ba53d/Development_SSD/AMQ_RH/apache-artemis-2.17-instance/artemis_instance_1/bin/artemis" run
      
      Or you can run the broker in the background using:
      
      "/mnt/79fece0c-d480-4c54-8268-eaf9ce6ba53d/Development_SSD/AMQ_RH/apache-artemis-2.17-instance/artemis_instance_1/bin/artemis-service" start
      
      $ ls -ltr
      total 4
      drwxrwxr-x. 8 chandrashekhar chandrashekhar 4096 Apr 24 21:37 artemis_instance_1
      
    3. Add the following acceptor in apache-artemis-2.17-instance/etc/broker.xml and save the file. Certificates are located in the example GitHub repo:
      <acceptors>
      ---
      <acceptor name="netty-ssl-acceptor">tcp://localhost:61621?sslEnabled=true;keyStorePath=/home/chandrashekhar/certificates/activemq.example.keystore;keyStorePassword=activemqexample</acceptor>
      ---
      </acceptors>
    4. Don't forget to modify the keystore path. Then, start the broker from the location apache-artemis-2.17-instance/bin:
      $ ./artemis run
      
      # we will see logs like
      
      2021-04-24 21:56:07,978 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
      ----
      ----
      2021-04-24 21:56:08,900 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at localhost:61621 for protocols [CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE]
      ----
      ----
      2021-04-24 21:56:08,920 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live
      2021-04-24 21:56:08,920 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.17.0 [0.0.0.0, nodeID=c6090ffc-a519-11eb-a4d5-b0fc366fae1f]

    Set up Red Hat Fuse on Karaf

    Next, set up Red Hat Fuse on Karaf:

    1. Download Red Hat Fuse and select the Karaf installer. At the time of writing this article, Red Hat Fuse 7.8 is the latest version.
    2. Unzip the file and run it from the bin folder:
      $ cd fuse-karaf-7.8.0.fuse-780038-redhat-00001/bin
      $./fuse
    3. You can use the mvn clean install command to build the application. The application code and certificates are located in the example GitHub repository.
    4. Modify the Camel route as per our requirements. Don't forget to update the truststore path. We are using Camel's Java Message Service (JMS) component with the Artemis connection factory (ActiveMQJMSConnectionFactory).
    5. In the Karaf console, install the following features and applications:
      karaf@root()> features:install pax-jms-artemis
      karaf@root()> features:install pax-jms-pool-pooledjms
      karaf@root()> features:install camel-jms
      karaf@root()> install -s mvn:com.mycompany/karafArtemis/1.0.0-SNAPSHOT
    6. In the Red Hat Fuse logs, you will see the following entries:
      [chandrashekhar@localhost log]$ tail -f fuse.log
      2021-04-24 22:40:59,731 | INFO | sConsumer[someQueue] | consume_message | 64 - org.apache.camel.camel-core - 2.23.2.fuse-780036-redhat-00001 | message 20210424 10:40
      2021-04-24 22:41:59,729 | INFO | sConsumer[someQueue] | consume_message | 64 - org.apache.camel.camel-core - 2.23.2.fuse-780036-redhat-00001 | message 20210424 10:41
      2021-04-24 22:42:59,734 | INFO | sConsumer[someQueue] | consume_message | 64 - org.apache.camel.camel-core - 2.23.2.fuse-780036-redhat-00001 | message 20210424 10:42
    7. In Artemis, we can check the queue statistics from the bin folder of the broker instance:
      $ pwd
      /path/to/apache-artemis-2.17-instance/artemis_instance_1/bin
      
      $ [chandrashekhar@localhost bin]$ ./artemis queue stat --user admin --password admin
      Connection brokerURL = tcp://localhost:61616
      |NAME |ADDRESS |CONSUMER_COUNT |MESSAGE_COUNT |MESSAGES_ADDED |DELIVERING_COUNT |MESSAGES_ACKED |SCHEDULED_COUNT |ROUTING_TYPE |
      |someQueue |someQueue |1 |0 |18 |0 |18 |0 |ANYCAST |
      [chandrashekhar@localhost bin]$

    Conclusion

    That's it! I hope you found this article interesting and helpful. You can find more details about these technologies at the following links:

    • Apache ActiveMQ Artemis
    • Apache Camel
    • Apache Camel JMS component
    Last updated: June 14, 2023

    Related Posts

    • Message broker integration made simple with Red Hat Fuse

    • How to configure a JDBC Appender for Red Hat Fuse 7 with Karaf

    • HTTP-based Kafka messaging with Red Hat AMQ Streams

    • Call an existing REST service with Apache Camel K

    • JMS 2.0 on Kubernetes with Apache ActiveMQ

    Recent Posts

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.