Spring Boot Camel Route From Solace To Artemis

Hi,

I have a Spring Boot application that I want to connect Solace to Apache Artemis. I have an instance of Solace installed on machine “A”, and Artemis installed on machine “B”.

Solace is configured with JNDI mapped to a queue.

I have a Spring Boot application which defines Beans for the Solace (JdniTemplate, JmsComponent, etc). I also have Beans defined for Artemis (ActiveMQConnectionFactory, JmsComponent)

I have a XML Camel Route defined such as going from the Solace queue to an Artemis queue.

When I run the Spring Boot application, I am getting an error below:

Note that “q2” is the queue created in Artemis. I’m new to JNDI. The stack trace implies it is trying to resolve the Artemis “q2” with SolJNDIInitialContextImpl, which I assume may be an issue - that Solace doesn’t know how to reach Artemis.

Can anyone help explain what the issue may be - and how I may be able to achieve my desired result of a camel route from Solace to Artemis?

ID:fe80:0:0:0:2d6a:8507:abb4:7ef4%wireless_32770c5c5196824dded20:0 on ExchangeId: 428AA2C07413092-0000000000000000). Exhausted after delivery attempt: 1 caught: org.springframework.jms.support.destination.DestinationResolutionException: Destination [q2] not found in JNDI

Message History (source location and message history is disabled)

Source ID Processor Elapsed (ms)
route2/route2 from[solaceJmsComponent://queue:billqueue] 2127

route2/to2 artemisJmsComponent:queue:q2 0

Stacktrace

org.springframework.jms.support.destination.DestinationResolutionException: Destination [q2] not found in JNDI
at org.springframework.jms.support.destination.JndiDestinationResolver.resolveDestinationName(JndiDestinationResolver.java:126) ~[spring-jms-6.2.5.jar!/:6.2.5]
at org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:115) ~[spring-jms-6.2.5.jar!/:6.2.5]
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.lambda$send$0(JmsConfiguration.java:590) ~[camel-jms-4.11.0.jar!/:4.11.0]

Caused by: javax.naming.NameNotFoundException: JNDI lookup of “q2” failed - not found
at com.solacesystems.jndi.SolJNDIInitialContextFactory$SolJNDIInitialContextImpl.lookup(SolJNDIInitialContextFactory.java:241) ~[sol-jms-jakarta-10.27.0.jar!/:na]

Hi there, I’m Solly AI, I generate responses to your questions using the power of the Solace Agent Mesh:

Please remember that AI technology can make mistakes so ensure that you read our Disclaimer.

AI Generated responses are a work in progress, your help in evaluating my response would be awesome! If my response makes sense, please mark it as a solution or give a :+1:. If my response doesn’t make sense for your topic, please react to it with a :shaking_face:.

Looking at the documentation and community discussions, here’s how to approach connecting a Spring Boot application between Solace software event broker and Apache Artemis:

The Solace JMS Connector requires JNDI configuration for connecting to JMS providers. However, there are two main approaches you can take:

  1. Using Apache Camel as a JMS bridge:
  • This is recommended by the Solace community for bridging between Solace and Apache Artemis
  • Allows using AMQP 1.0 protocol without requiring JNDI
  • Can be configured in Spring Boot using Camel routes
  1. Using the Solace JMS Connector:
  • Requires JNDI configuration for the JMS provider connection
  • Uses JCSMP (Solace Java API) for the Solace side
  • Provides better integration with Solace features

For your specific case, since you mentioned having only AMQP host details without JNDI, the Apache Camel approach would be more suitable.

Key configuration points:

  • Configure Solace connection using Spring Boot auto-configuration
  • Set up Camel routes to bridge between Solace and Artemis
  • Use multiple binder syntax if connecting to multiple systems

Relevant documentation:

Note that while AMQP 1.0 is supported by both systems, direct broker-to-broker connections using AMQP are not supported - a bridging component like Camel or the JMS Connector is required.