Is the datasource between shared in Camel Route ?

Solution Unverified - Updated -

Issue

  • I Want to verify if the Datasource is shared ?
  • I have a camel route defined in a bundle that runs under osgi in fuse. In the camel-context I have a datasource defined, the camel route monitors a ActiveMQ queue, then pulls the message and processes it to put it into the database. As mentioned the datasource is defined in the camel context.
  • When a message is put on the queue, the route starts by converting from XML to java object. Then route creates a JdbcTemplate object. This object performs the SQL operation. The route ends.
  • What I am trying to verify is the following:

    • 1) the DataSource is created during the install/start of the feature. It is not created and destroyed each time the route is called. The route would use the datasource pooling.
    • 2) if multiple messages come in, and threads are created, all threads share the original datasource. Each thread again would use the datasource pooling, and not create a new datasource.
  • This listed above is how I think it works, but I would like to verify I am on the right path.

  • My code works, I just want to be sure this is a datasource is only created one time.

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.