[ 
https://issues.apache.org/activemq/browse/AMQ-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39008
 ] 

Alf E. Helseth commented on AMQ-895:
------------------------------------

Thanks, that really helped me a lot!

I was now able to create a simple wrapper similar to yours and managed finally 
to make i all work.
Am wrapping around the class com.stc.jms.client.STCQueueConnectionFactory (from 
JCAPS), and this must have hostname & port number in the constructor. Handled 
this by hard-coding these values in the wrapper so far, but would like to fetch 
these from properties as well, but don't  know how...?
Like this:

public class connectionFactoryWrapper extends 
com.stc.jms.client.STCQueueConnectionFactory {

    public connectionFactoryWrapper() throws JMSException
    { 
        super("localhost", 18007); 
    }
....
    


Then the bridging works only one way, namely from AMQ to JCAPS. 
The other way AMQ gets a ClassCastException upon receiving the message from the 
JCAPS queue:

ERROR DestinationBridge              - failed to forward message on attempt: 1 
reason: java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue 
message: [EMAIL PROTECTED] 
java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue
        at com.stc.jms.message.STCMessage.setJMSDestination(STCMessage.java:611)
        at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1505)
        at 
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
        at 
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:415)
        at 
org.apache.activemq.ActiveMQQueueSender.send(ActiveMQQueueSender.java:116)
        at 
org.apache.activemq.network.jms.QueueBridge.sendMessage(QueueBridge.java:87)
        at 
org.apache.activemq.network.jms.DestinationBridge.onMessage(DestinationBridge.java:134)
        at 
com.stc.jms.client.SessionImpl.processAsyncDataAvailable(SessionImpl.java:1659)
        at com.stc.jms.client.SessionImpl.processAsync(SessionImpl.java:1748)
        at com.stc.jms.client.SessionImpl.asyncEnter(SessionImpl.java:1776)
        at com.stc.jms.client.SessionImpl.access$500(SessionImpl.java:56)
        at com.stc.jms.client.SessionImpl$3.run(SessionImpl.java:1899)
        at com.stc.jms.client.SessionImpl$2.run(SessionImpl.java:1807)
        at java.lang.Thread.run(Thread.java:595)


The problem seems to be the STCTextMessage class, is it possible to handle this 
in some way?


Regards
-Alf

> JMS to JMS Bridge never reconnects under remote broker restarts.
> ----------------------------------------------------------------
>
>                 Key: AMQ-895
>                 URL: https://issues.apache.org/activemq/browse/AMQ-895
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0 RC2, 4.0.1
>            Reporter: Manuel Teira
>         Attachments: test_patch.diff
>
>
> I'm using ActiveMQ (4.0.1) JMS to JMS Bridge functionality to connect to a  
> SunMQ JMS Broker (3.6 SP3  (Build 02-A)). I'm using two queues, an input and 
> an output one, with the following configuration:
>     <jmsBridgeConnectors>
>       <jmsQueueConnector outboundQueueConnectionFactory="#REMOTE">
>       <outboundQueueBridges>
>         <outboundQueueBridge outboundQueueName="SUNRECV"/>
>       </outboundQueueBridges>
>       <inboundQueueBridges>
>         <inboundQueueBridge inboundQueueName="SUNSEND"/>
>       </inboundQueueBridges>
>       </jmsQueueConnector>
>     </jmsBridgeConnectors>
> The system works really well until the SunMQ broker needed to be restarted. 
> This is what I found:
> 1.-ActiveMQ is not aware of the remote broker shutdown. I waited for a while, 
> but no log on ActiveMQ indicates knowledge about the new situation.
> 2.-When I send a message to the output queue SUNRECV, ActiveMQ complains that 
> the producer is closed:
> [ERROR][2006/08/25.09:47:12.039][ActiveMQ Session Task]failed to forward 
> message: ActiveMQTextMessage {commandId = 5, responseRequired = false, 
> messageId = ID:trabucco-43457-1156491843149-3:4:1:1:1, originalDestination = 
> null, originalTransactionId = null, producerId = 
> ID:trabucco-43457-1156491843149-3:4:1:1, destination = queue://SUNRECV, 
> transactionId = null, expiration = 0, timestamp = 1156492032027, arrival = 0, 
> correlationId = null, replyTo = null, persistent = false, type = null, 
> priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, 
> compressed = false, userID = null, content = null, marshalledProperties = 
> null, dataStructure = null, redeliveryCounter = 0, size = 2, properties = 
> null, readOnlyProperties = true, readOnlyBody = true, text = 1}([C4064]: 
> Cannot perform operation, producer is closed.)
>  After this, it is automatically queueing messages without sending them, 
> showing the log:
> [DEBUG][2006/08/25.09:47:42.721][RMI TCP Connection(4)-10.95.89.20]No 
> subscriptions registered, will not dispatch message at this time.
>  Even if SunMQ is started again, ActiveMQ is not detecting the new situation, 
> and continues queueing messages sent to SUNRECV.
> Please, make me know if more information is needed to understand the 
> situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to