>
> The problem is that there doesn't seem to be anywhere to specify the
> username and password used when the connection is created as there is in
> code. So I tried somewhat desperately to use the connection factory from
> ActiveMQ and set the connection factory in the jms component to use it
> (using the #connectionFactory as the value)
>
>   <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="tcp://localhost:61616" />
>     <property name="userName" value="xyUser" />
>     <property name="password" value="xyPass" />
>   </bean>
>
> But that just seemed give me a local connection out of the pool, which
> isn't
> what I needed. I needed to get a connection from the factory on the other
> JMS server.

What you've done above to specify the username/password on the
connectionFactory is correct, but I'm not sure what you mean be 'the
other JMS server'? Is there more than one ActiveMQ broker being used?
Please clarify this further.

Bruce
-- 

What we have is a JBoss server which has a JMS topic that is used by
external programs to get events coming from the server. The java code you
saw earlier was an example of a simple java client that receives messages
from this server. That JMS client code starts the topic connection then sets
itself up as the topic listener - to add to the previously posted code,
there is an onMessage() method that is called whenever the message is
received -

/***** java client to JMS topic
TopicConnection topicConnection = factory.createTopicConnection("xyUser",
"xyPass");

TopicSession topicSession = topicConnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
TopicSubscriber topicSubscriber = topicSession.createSubscriber(eventTopic);
System.out.println("Connected to topic.");
topicSubscriber.setMessageListener(this);

    public void onMessage(Message message)
    {
        try
        {
            TextMessage textMessage = (TextMessage) message;
        String eventXml = textMessage.getText();
            ......
****** end java code */

If I fire up this client, then look in the JMX console of the JBoss server
and look at the topic, I will see a connection. 

When using the connection broker with the username and password set, there
are no error messages. However, I see no connections to the JMS topic using
the JMX console in the Jboss server.

This tells me one of two things -
1. the servicemix-jms component never connected. OR
2. The component connected, checked for messages, then disconnected.

So, to answer your question, the topic is hosted on some jboss server on
another box. This servicemix jms component needs to connect to it, stay
connected, and receive all the messages coming out of it.


-- 
View this message in context: 
http://www.nabble.com/JMS-consumer-issue-tf4957536s12049.html#a14201051
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to