Announcement Announcement Module
Collapse
No announcement yet.
How to using activemq in spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to using activemq in spring

    Hi All,
    Now i using activemq3.0 in spring to provider a jms server for my application, this is my current problem:

    1. I want to start activemq when my application start and create some topic and queue defined in config file, who can I write the config file?

    2. I want use mysql as activemq's persistence type to store the message, who can I write the config file?

    3. In runtime, I want send & receive message from topic/queue in my application, and I want using JNDI to send & receive message from same topic/queue in a standalone program, what issue should be noticed in config file, have some examples I can reference?

    otherwise, if I want using activemq jca feature, who can I write the config file?

    Appreciate any help, thanks

  • #2
    Check out the docs on the ActiveMQ website that cover Spring integration and JCA.

    Rob

    Comment


    • #3
      Re: How to using activemq in spring

      I'll answer these in reverse order a little.

      3. To use JNDI to setup topics/queues inside JNDI along with the required connection factories, see...

      http://activemq.org/JNDI+Support

      2. To configure a different JDBC database, see the activemq.xml that comes with the binary distribution of ActiveMQ; it just uses straight Spring to setup the JDBC connection itself, refer to the Spring manuals for more details.

      1. If you want the activemq broker to start when your application starts you can do a few things. If you use an embedded broker, then ActiveMQ will start the broker when you start a JMS connection...

      http://activemq.org/How+do+I+embed+a...e+a+Connection

      Or you could use a servlet to initialise ActiveMQ from inside your servlet engine if you wish. (The 3.1-SNAPSHOT binary has an example WAR for doing this - if you download the snapshot then type 'ant war' in the example directory it'll make a self-starting WAR for you).

      Finally, you might want to use the Spring based JCA container in ActiveMQ to manage your subscriptions using connection/session/thread/bean pooling...

      http://activemq.org/JCA+Container

      Comment


      • #4
        thanks, but I want a config file solve all above questions, what shall I do? are there have a example? If I only use vm://hostname as brokerURL and vmPersistence mode when useEmbeddedBroker property is true?

        Comment


        • #5
          Originally posted by joyheros
          thanks, but I want a config file solve all above questions, what shall I do? are there have a example? If I only use vm://hostname as brokerURL and vmPersistence mode when useEmbeddedBroker property is true?
          Each of the comments and links above refers to a configuration file example. So you'll have a jndi.properties for JNDI, an activemq.xml for the broker configuration and the spring.xml for the JCA Container configuration.

          Comment

          Working...
          X