Andrew Klimov
Andrew Klimov

Reputation: 124

Apache Camel + Oracle AQ + Tomcat conceptual question

Environment:

Tomcat 10.1.9 under Windows 11

Apache Camel 4.0.2

Oracle 21c EE under Windows 11, with oracle.jakarta.jms.AqjmsConnectionFactory as connectionFactory.

I wrote an application that runs under Tomcat as a servlet and provides message exchange between the servlet and the Oracle queue through a Apache Camel JMS component.

The servlet implements the service method. If the servlet is accessed via GET, the message is queued from the URL parameter.

Route: direct:start => queueEndpoint

If the queue supplies data, then through another route(queueEndpoint=> servletURL),

messages arrive at the servlet using the method POST. A component that ensures data delivery to a given URL is Camel-HTTP component.

The required beans (jmsConnectionFactory, JmsConfiguration, JmsComponent, JmsEndpoint) provided in configuration file.

Listener org.springframework.web.context.ContextLoaderListener included into the web.xml

Application works good. I just have a conceptual questions.

When the application starts, who cares about listening of Oracle queue? Does it JmsComponent internal listener? Or does it Spring ContextLoaderListener? Or it is a CamelContext internal feature(embedded listener?)? Please help, I'm confused...

TIA, Andrew.

I want to add some edits.

My understanding is that:

once an JMS endpoint is included in the Camel context's route, then the Camel context is responsible for messages arriving at that JMS endpoint, right?

More precisely: CamelContext starts under servlet's context, and JMS component(with all surrounding stuff: factory, endpoint,...) starts under Camel context. JMS factory creates listening thread for JMS endpoint.

Listening thread catches messages, which come from that endpoint and creates exchange with Camel "from" route point. Is it correct, or not?

TIA, Andrew.

Upvotes: 0

Views: 81

Answers (0)

Related Questions