Hi you can use Proxy.getInvocationHandler(instance) I guess

see https://issues.apache.org/jira/browse/AMQ-3926 value was wrong but
the idea is the one


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-09-24 14:59 GMT+02:00 Felipe Jaekel <[email protected]>:
> Hi,
>
> I'm trying to run some legacy JMS code in TomEE 1.7.0 using the internal
> broker:
>
>     <Resource id="JmsResourceAdapter" type="ActiveMQResourceAdapter">
>         BrokerXmlConfig =  broker:(tcp://localhost:61616?daemon=true)
>         ServerUrl       =  vm://localhost
>     </Resource>
>
> In this code the redelivery policy is changed:
>
> QueueConnectionFactory connectionFactory = (QueueConnectionFactory)
> initialContext.lookup("openejb:Resource/JmsConnectionFactory");
>
> connection = (ActiveMQConnection) connectionFactory.createQueueConnection();
>
> RedeliveryPolicy redeliveryPolicy = connection.getRedeliveryPolicy();
> redeliveryPolicy.setRedeliveryDelay(30000);
> connection.setRedeliveryPolicy(redeliveryPolicy);
>
> I'm getting the following exception when I try to cast the connection:
> java.lang.ClassCastException: com.sun.proxy.$Proxy156 cannot be cast to
> org.apache.activemq.ActiveMQConnection
>
> Is it possible to set the redelivery policy in tomee.xml? If not, I noticed
> while debugging in Eclipse
> that there is a ManagedConnectionProxy instance behind the proxy, and this
> class has a physicalConnection property that holds the current
> ActiveMQConnection instance. How can I access it?
>
> Thanks

Reply via email to