You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by gpulido <ga...@gmail.com> on 2012/06/24 13:32:48 UTC

ActiveMQ 5.6 stomp object transformation

Hello,

I'm trying to send a message from a Stomp client to a embedded instance of
an ActiveMQ 5.6.

The message is an xml representation of an object, so when I send it to the
queue using stomp I add the transformation keys to the header:

"transformation:jms-object-xml"

When I send the message the activeMQ acknowledges it but receives it as a
ActiveMQTextMessage instead of an ObjectMessage. So it seems that is
ignoring the transformation header.

Using the same configuration, only changing the dependency from ActiveMQ 5.6
to ActiveMQ 5.4.3 the same message using the same client and with the same
header worked:
The embedded activeMQ instance acknowledges the message and it is an
ObjectMessage instance, and all worked.

I really need to move up to the 5.6 version, but I also need to be able to
send messages using the stomp client.
Anyone could help me to find what am I missing here?

Thank you


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.6 stomp object transformation

Posted by gpulido <ga...@gmail.com>.
Hello Dejan,

I'm already using xstream to serialize the objects, however instead of
annotations I'm using an XStream instance configured for each object
(although the default serialization is just enough). This way I could avoid
using a Xstream dependency on the POJO that could not be compatible with
other systems (I'm using the same POJO objects on an android client)

I'll take a look to create the test scenario on which the the 5.4 works and
the 5.6 don't.
Thank you again for your patience.

Gabriel Pulido

2012/6/26 dejanb [via ActiveMQ] <ml...@n4.nabble.com>

> Hi Gabriel,
>
> take a look at
>
> http://xstream.codehaus.org/annotations-tutorial.html
>
> I'm not sure your code uses annotations to convert Java objects, so
> that might not be related. But without more info, I can't help you
> more. The best course of action is to try creating some kind of a test
> case that demonstrates your problem with 5.6.0.
>
>
> Regards
> --
> Dejan Bosanac
> Senior Software Engineer | FuseSource Corp.
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4653588&i=0> |
> fusesource.com
> skype: dejan.bosanac | twitter: @dejanb
> blog: http://www.nighttale.net
> ActiveMQ in Action: http://www.manning.com/snyder/
>
>
> On Tue, Jun 26, 2012 at 5:47 PM, gpulido
> <[hidden email] <http://user/SendEmail.jtp?type=node&node=4653588&i=1>>
> wrote:
>
> > Hello again,
> >
> > Maybe this is a very basic question but how can I do  the class mapping
> set
> > configuration in an embedded broker without using the xml file to set
> this:
> >
> >  <bean class="org.apache.activemq.util.XStreamFactoryBean"
> name="xstream">
> >  <property name="annotatedClass"><value>org.apache.activemq.transport.
> > stomp.SamplePojo</value></property>
> >  </bean>
> >
> > On the version 5.4 I was capable of configure the embedded broker
> without
> > using the xml
> >
> > Thank you very much in advance
> > Gabriel Pulido
> >
> >
> >
> > 2012/6/25 gpulido [via ActiveMQ] <[hidden email]<http://user/SendEmail.jtp?type=node&node=4653588&i=2>>
>
> >
> >> Hello,
> >> Thanks for the answers.
> >>
> >> I'll check however why it worked with the activeMQ 5.4 and only
> changing
> >> the jar dependency to use the activeMQ 5.6 it stops working?
> >>
> >> The activeMq is started inside a java application, using the
> BrokerService
> >> class. How can I configure the annotatedClass property using this
> >> mechanism?
> >>
> >> Thank you in advance
> >> Regards
> >>
> >> Gabriel Pulido
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
>
> >> .
> >> NAML<
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> > --
> > View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653586.html
>
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653588.html
>  To unsubscribe from ActiveMQ 5.6 stomp object transformation, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653524&code=Z2FicmllbC5wdWxpZG9kZXRvcnJlc0BnbWFpbC5jb218NDY1MzUyNHwtMTE3ODg5MjAyMA==>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653590.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.6 stomp object transformation

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi Gabriel,

take a look at

http://xstream.codehaus.org/annotations-tutorial.html

I'm not sure your code uses annotations to convert Java objects, so
that might not be related. But without more info, I can't help you
more. The best course of action is to try creating some kind of a test
case that demonstrates your problem with 5.6.0.


Regards
--
Dejan Bosanac
Senior Software Engineer | FuseSource Corp.
dejanb@fusesource.com | fusesource.com
skype: dejan.bosanac | twitter: @dejanb
blog: http://www.nighttale.net
ActiveMQ in Action: http://www.manning.com/snyder/


On Tue, Jun 26, 2012 at 5:47 PM, gpulido
<ga...@gmail.com> wrote:
> Hello again,
>
> Maybe this is a very basic question but how can I do  the class mapping set
> configuration in an embedded broker without using the xml file to set this:
>
>  <bean class="org.apache.activemq.util.XStreamFactoryBean" name="xstream">
>  <property name="annotatedClass"><value>org.apache.activemq.transport.
> stomp.SamplePojo</value></property>
>  </bean>
>
> On the version 5.4 I was capable of configure the embedded broker without
> using the xml
>
> Thank you very much in advance
> Gabriel Pulido
>
>
>
> 2012/6/25 gpulido [via ActiveMQ] <ml...@n4.nabble.com>
>
>> Hello,
>> Thanks for the answers.
>>
>> I'll check however why it worked with the activeMQ 5.4 and only changing
>> the jar dependency to use the activeMQ 5.6 it stops working?
>>
>> The activeMq is started inside a java application, using the BrokerService
>> class. How can I configure the annotatedClass property using this
>> mechanism?
>>
>> Thank you in advance
>> Regards
>>
>> Gabriel Pulido
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653543.html
>>  To unsubscribe from ActiveMQ 5.6 stomp object transformation, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653524&code=Z2FicmllbC5wdWxpZG9kZXRvcnJlc0BnbWFpbC5jb218NDY1MzUyNHwtMTE3ODg5MjAyMA==>
>> .
>> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653586.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.6 stomp object transformation

Posted by gpulido <ga...@gmail.com>.
Hello again,

Maybe this is a very basic question but how can I do  the class mapping set
configuration in an embedded broker without using the xml file to set this:

 <bean class="org.apache.activemq.util.XStreamFactoryBean" name="xstream">
  <property name="annotatedClass"><value>org.apache.activemq.transport.
stomp.SamplePojo</value></property>
  </bean>

On the version 5.4 I was capable of configure the embedded broker without
using the xml

Thank you very much in advance
Gabriel Pulido



2012/6/25 gpulido [via ActiveMQ] <ml...@n4.nabble.com>

> Hello,
> Thanks for the answers.
>
> I'll check however why it worked with the activeMQ 5.4 and only changing
> the jar dependency to use the activeMQ 5.6 it stops working?
>
> The activeMq is started inside a java application, using the BrokerService
> class. How can I configure the annotatedClass property using this
> mechanism?
>
> Thank you in advance
> Regards
>
> Gabriel Pulido
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653543.html
>  To unsubscribe from ActiveMQ 5.6 stomp object transformation, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653524&code=Z2FicmllbC5wdWxpZG9kZXRvcnJlc0BnbWFpbC5jb218NDY1MzUyNHwtMTE3ODg5MjAyMA==>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653586.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.6 stomp object transformation

Posted by gpulido <ga...@gmail.com>.
Hello,
Thanks for the answers.

I'll check however why it worked with the activeMQ 5.4 and only changing the
jar dependency to use the activeMQ 5.6 it stops working?

The activeMq is started inside a java application, using the BrokerService
class. How can I configure the annotatedClass property using this mechanism?

Thank you in advance
Regards

Gabriel Pulido

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524p4653543.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.6 stomp object transformation

Posted by Dejan Bosanac <de...@nighttale.net>.
A few things to check:

1) Do you have you class mapping set in activemq.xml, like

  <bean class="org.apache.activemq.util.XStreamFactoryBean" name="xstream">
  		<property name="annotatedClass"><value>org.apache.activemq.transport.stomp.SamplePojo</value></property>
  </bean>

2) Do you have XStream dependency in your classpath?


Regards
--
Dejan Bosanac
Senior Software Engineer | FuseSource Corp.
dejanb@fusesource.com | fusesource.com
skype: dejan.bosanac | twitter: @dejanb
blog: http://www.nighttale.net
ActiveMQ in Action: http://www.manning.com/snyder/


On Sun, Jun 24, 2012 at 3:42 PM, Timothy Bish <ta...@gmail.com> wrote:
> On Sun, 2012-06-24 at 04:32 -0700, gpulido wrote:
>> Hello,
>>
>> I'm trying to send a message from a Stomp client to a embedded instance of
>> an ActiveMQ 5.6.
>>
>> The message is an xml representation of an object, so when I send it to the
>> queue using stomp I add the transformation keys to the header:
>>
>> "transformation:jms-object-xml"
>>
>> When I send the message the activeMQ acknowledges it but receives it as a
>> ActiveMQTextMessage instead of an ObjectMessage. So it seems that is
>> ignoring the transformation header.
>>
>> Using the same configuration, only changing the dependency from ActiveMQ 5.6
>> to ActiveMQ 5.4.3 the same message using the same client and with the same
>> header worked:
>> The embedded activeMQ instance acknowledges the message and it is an
>> ObjectMessage instance, and all worked.
>>
>> I really need to move up to the 5.6 version, but I also need to be able to
>> send messages using the stomp client.
>> Anyone could help me to find what am I missing here?
>>
>> Thank you
>
> There are unit tests which are working fin for transformation so I'd
> suggest that you take a look at those and see if you can create a test
> case that demonstrate the scenario that is not working.  Once you have
> you should open a Jira issue and attach your test case, this will ensure
> that someone can reproduce it when they look into the problem.
>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
> --
> Tim Bish
> Sr Software Engineer | FuseSource Corp
> tim.bish@fusesource.com | www.fusesource.com
> skype: tabish121 | twitter: @tabish121
> blog: http://timbish.blogspot.com/
>

Re: ActiveMQ 5.6 stomp object transformation

Posted by Timothy Bish <ta...@gmail.com>.
On Sun, 2012-06-24 at 04:32 -0700, gpulido wrote: 
> Hello,
> 
> I'm trying to send a message from a Stomp client to a embedded instance of
> an ActiveMQ 5.6.
> 
> The message is an xml representation of an object, so when I send it to the
> queue using stomp I add the transformation keys to the header:
> 
> "transformation:jms-object-xml"
> 
> When I send the message the activeMQ acknowledges it but receives it as a
> ActiveMQTextMessage instead of an ObjectMessage. So it seems that is
> ignoring the transformation header.
> 
> Using the same configuration, only changing the dependency from ActiveMQ 5.6
> to ActiveMQ 5.4.3 the same message using the same client and with the same
> header worked:
> The embedded activeMQ instance acknowledges the message and it is an
> ObjectMessage instance, and all worked.
> 
> I really need to move up to the 5.6 version, but I also need to be able to
> send messages using the stomp client.
> Anyone could help me to find what am I missing here?
> 
> Thank you

There are unit tests which are working fin for transformation so I'd
suggest that you take a look at those and see if you can create a test
case that demonstrate the scenario that is not working.  Once you have
you should open a Jira issue and attach your test case, this will ensure
that someone can reproduce it when they look into the problem.  

> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-6-stomp-object-transformation-tp4653524.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | FuseSource Corp
tim.bish@fusesource.com | www.fusesource.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/