views:

34

answers:

1

Hi,

how can I configure OpenEJB to work with an external instance of ActiveMQ?

We already tried the configuration on this link http://openejb.apache.org/3.0/jms-resources-and-mdb-container.html but it did'nt work at all.

What should we do?

+1  A: 

Try following in your openejb.xml:

<openejb>
    <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
        ServerUrl tcp://someHostName:61616
    </Resource>

    <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
        ResourceAdapter MyJmsResourceAdapter
    </Resource>

    <Container id="MyJmsMdbContainer" ctype="MESSAGE">
        ResourceAdapter MyJmsResourceAdapter
    </Container>

    <Resource id="FooQueue" type="javax.jms.Queue"/>
    <Resource id="BarTopic" type="javax.jms.Topic"/>
</openejb>

Taken from this doc

David Blevins
Is there a way to upgrade OpenEJB to use ActiveMQ 5.4? Internally or externally...
grigory
The coming 3.1.3 binaries support ActiveMQ 5.x. It will ship with 5.3.1, but should be easy to yank those out and add 5.4. Maybe we can sneak out a 3.1.4 with ActiveMQ 5.4.1.
David Blevins
I've already tried that. But it simply doesn´t work.
Kico Lobo
@Kico: You've tried that with 3.1.3 snapshot or with 3.1.2?
grigory
@Kico: I've had the same experience with this setup. If you don't get a connection refused exception when OpenEJB starts, then things are hooked up correctly. My mistake in doing similar was that the topic/queue names did not line-up. ActiveMQ will happily create any topic/queue you ask for and never gives a "no such topic" type of exception. Nor does it log the topics and queues it does create. Fortunately ActiveMQ has good JMX support and I was able to use jconsole to browse around the broker and see what topics/queues existed and how many messages they had. Give that a try.
David Blevins
I'm using 3.1.2
Kico Lobo
@DavidBlevins - I tried that. But didn't work also. In this case, all I should do was to add this configuration to the end of the .xml file, right? Or should I replace the existing configuration?
Kico Lobo
@Kico: Replace. Of course add back in any changed things like data sources. But in general terms you can run OpenEJB with an xml file that contains only "<openejb/>", just you only would get defaults.
David Blevins
@David: when is 3.1.3 release scheduled?
grigory
@grigory: It's up for a vote http://markmail.org/message/drpsrrzeybrotr5n Will probably close that vote and push it out today or tomorrow.
David Blevins