<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Doing flex with JMS: combining BlazeDS, spring-jms and ActiveMQ</title>
	<atom:link href="http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/</link>
	<description>A weblog about software engineering, Architecture, Technology an other things we like.</description>
	<lastBuildDate>Sat, 28 Jan 2012 20:11:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kshitiz Garg</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-30482</link>
		<dc:creator>Kshitiz Garg</dc:creator>
		<pubDate>Tue, 14 Sep 2010 16:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-30482</guid>
		<description>Hi,

I am trying to run a web application based on spring consisting of standalone AMQ &amp; Tomcat. I am not able to see my message being produced/consumed anywhere. This is my code:

TopicSender
=========
import java.io.Serializable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.jms.Topic;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;

public class TopicMessageSender {
private JmsTemplate jmsTemplate;
private Topic topic;

public void produce(final Serializable object) {
System.out.println(“inside produce”);
this.jmsTemplate.send(this.topic, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
ObjectMessage mm = session.createObjectMessage();
mm.setObject(object);
return mm;
}
});
}

@Required
public void setJmsTemplate(JmsTemplate jmsTemplate) {
this.jmsTemplate = jmsTemplate;
}

@Required
public void setTopic(Topic topic) {
this.topic = topic;
}
}

TopicMessageListener1
==================
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

public class TopicMessageListener1 implements MessageListener{

@Override
public void onMessage(Message message) {
try {
if (message instanceof ObjectMessage) {
ObjectMessage mapMessage = (ObjectMessage) message;
Object obj = mapMessage.getObject();
System.out.println(“Printing from Subs1″+obj);
}
} catch (Exception e) {
// handle exception
}
}
}

Employee
=========
import java.io.Serializable;
import java.util.Date;

public class Employee implements Serializable {
private static final long serialVersionUID = 1L;
String lName=”Garg”;
String fName=”Kshitiz”;
double salary = 25000;
Date hireDate = new Date();
String address=”Gurgaon”;
public String getlName() {
return lName;
}
public void setlName(String lName) {
this.lName = lName;
}
public String getfName() {
return fName;
}
public void setfName(String fName) {
this.fName = fName;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public java.util.Date getHireDate() {
return hireDate;
}
public void setHireDate(java.util.Date hireDate) {
this.hireDate = hireDate;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

Relevant config file settings
====================
 &lt;!-- ActiveMQ Integration starts here --&gt;
    &lt;!-- below are the connection settings for the ActiveMQ --&gt;
    
        
            
                
                  tcp://localhost:61616
                
            
        
    
   
    &lt;!-- Spring JMS Template --&gt;
    
        
            
        
    

         
    
          
          
    
   
    &lt;!-- Generate a Topic --&gt;
    
          
    
   
    &lt;!-- Configure a message listener for the above topic --&gt;
    
    
          
    

    &lt;!-- Configure a message listener for the above topic --&gt;
    
    
          
    



I am not able to figure out the exact problem. Can you please help me ?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am trying to run a web application based on spring consisting of standalone AMQ &#038; Tomcat. I am not able to see my message being produced/consumed anywhere. This is my code:</p>
<p>TopicSender<br />
=========<br />
import java.io.Serializable;</p>
<p>import javax.jms.JMSException;<br />
import javax.jms.Message;<br />
import javax.jms.ObjectMessage;<br />
import javax.jms.Session;<br />
import javax.jms.Topic;</p>
<p>import org.springframework.beans.factory.annotation.Required;<br />
import org.springframework.jms.core.JmsTemplate;<br />
import org.springframework.jms.core.MessageCreator;</p>
<p>public class TopicMessageSender {<br />
private JmsTemplate jmsTemplate;<br />
private Topic topic;</p>
<p>public void produce(final Serializable object) {<br />
System.out.println(“inside produce”);<br />
this.jmsTemplate.send(this.topic, new MessageCreator() {<br />
public Message createMessage(Session session) throws JMSException {<br />
ObjectMessage mm = session.createObjectMessage();<br />
mm.setObject(object);<br />
return mm;<br />
}<br />
});<br />
}</p>
<p>@Required<br />
public void setJmsTemplate(JmsTemplate jmsTemplate) {<br />
this.jmsTemplate = jmsTemplate;<br />
}</p>
<p>@Required<br />
public void setTopic(Topic topic) {<br />
this.topic = topic;<br />
}<br />
}</p>
<p>TopicMessageListener1<br />
==================<br />
import javax.jms.Message;<br />
import javax.jms.MessageListener;<br />
import javax.jms.ObjectMessage;</p>
<p>public class TopicMessageListener1 implements MessageListener{</p>
<p>@Override<br />
public void onMessage(Message message) {<br />
try {<br />
if (message instanceof ObjectMessage) {<br />
ObjectMessage mapMessage = (ObjectMessage) message;<br />
Object obj = mapMessage.getObject();<br />
System.out.println(“Printing from Subs1″+obj);<br />
}<br />
} catch (Exception e) {<br />
// handle exception<br />
}<br />
}<br />
}</p>
<p>Employee<br />
=========<br />
import java.io.Serializable;<br />
import java.util.Date;</p>
<p>public class Employee implements Serializable {<br />
private static final long serialVersionUID = 1L;<br />
String lName=”Garg”;<br />
String fName=”Kshitiz”;<br />
double salary = 25000;<br />
Date hireDate = new Date();<br />
String address=”Gurgaon”;<br />
public String getlName() {<br />
return lName;<br />
}<br />
public void setlName(String lName) {<br />
this.lName = lName;<br />
}<br />
public String getfName() {<br />
return fName;<br />
}<br />
public void setfName(String fName) {<br />
this.fName = fName;<br />
}<br />
public double getSalary() {<br />
return salary;<br />
}<br />
public void setSalary(double salary) {<br />
this.salary = salary;<br />
}<br />
public java.util.Date getHireDate() {<br />
return hireDate;<br />
}<br />
public void setHireDate(java.util.Date hireDate) {<br />
this.hireDate = hireDate;<br />
}<br />
public String getAddress() {<br />
return address;<br />
}<br />
public void setAddress(String address) {<br />
this.address = address;<br />
}<br />
}</p>
<p>Relevant config file settings<br />
====================<br />
 <!-- ActiveMQ Integration starts here --><br />
    <!-- below are the connection settings for the ActiveMQ --></p>
<p>                  tcp://localhost:61616</p>
<p>    <!-- Spring JMS Template --></p>
<p>    <!-- Generate a Topic --></p>
<p>    <!-- Configure a message listener for the above topic --></p>
<p>    <!-- Configure a message listener for the above topic --></p>
<p>I am not able to figure out the exact problem. Can you please help me ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BlazeDS,LiveCycle DS Configuration &#171; Niamathbasha&#8217;s Weblog</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-24642</link>
		<dc:creator>BlazeDS,LiveCycle DS Configuration &#171; Niamathbasha&#8217;s Weblog</dc:creator>
		<pubDate>Thu, 09 Jul 2009 11:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-24642</guid>
		<description>[...] the destinations of messaging is done in the messaging-config.xml file. The file looks like this.   view sourceprint?   01.&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; 02.&lt;service id=&quot;message-service&quot; [...]</description>
		<content:encoded><![CDATA[<p>[...] the destinations of messaging is done in the messaging-config.xml file. The file looks like this.   view sourceprint?   01.&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; 02.&lt;service id=&quot;message-service&quot; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jettro</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21643</link>
		<dc:creator>jettro</dc:creator>
		<pubDate>Mon, 27 Apr 2009 18:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21643</guid>
		<description>Good question, most important reason for me was that I did not need another config file. This way I could do it from within spring configuration.</description>
		<content:encoded><![CDATA[<p>Good question, most important reason for me was that I did not need another config file. This way I could do it from within spring configuration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jochen Szostek</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21636</link>
		<dc:creator>Jochen Szostek</dc:creator>
		<pubDate>Mon, 27 Apr 2009 14:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21636</guid>
		<description>Hello Jettro,

First up, thanks a lot for this (and other) interesting article!

I was wondering why you&#039;re using the XBean approach instead of the Spring approach which is also mentioned in the link you posted. (http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html)

Greetings from Belgium!

Jochen</description>
		<content:encoded><![CDATA[<p>Hello Jettro,</p>
<p>First up, thanks a lot for this (and other) interesting article!</p>
<p>I was wondering why you&#8217;re using the XBean approach instead of the Spring approach which is also mentioned in the link you posted. (<a href="http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html" rel="nofollow">http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html</a>)</p>
<p>Greetings from Belgium!</p>
<p>Jochen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21279</link>
		<dc:creator>Stephan</dc:creator>
		<pubDate>Wed, 15 Apr 2009 07:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21279</guid>
		<description>Mark, Is it also possible to bridge the Spring Integration library with a Flex destination ?</description>
		<content:encoded><![CDATA[<p>Mark, Is it also possible to bridge the Spring Integration library with a Flex destination ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jettro</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21268</link>
		<dc:creator>jettro</dc:creator>
		<pubDate>Tue, 14 Apr 2009 21:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21268</guid>
		<description>That is great news, I was actually very surprised that you had to go through all this trouble. I&#039;ll be checking out the new Spring BlazeDS integration the coming weeks.</description>
		<content:encoded><![CDATA[<p>That is great news, I was actually very surprised that you had to go through all this trouble. I&#8217;ll be checking out the new Spring BlazeDS integration the coming weeks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Grelle</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21261</link>
		<dc:creator>Jeremy Grelle</dc:creator>
		<pubDate>Tue, 14 Apr 2009 20:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21261</guid>
		<description>Jettro,

Great post!  Like Mark said, I definitely think you&#039;ll like the messaging support we&#039;ve been working on for the upcoming RC1...makes this much easier.  Another thing worth pointing out is that when I read your requirements, it made me think, &quot;Why do we need JMS at all for something simple like this?&quot;.  It&#039;s the same thought I had when working on some examples, and so we&#039;ve also added an even simpler MessageTemplate that uses the &quot;native&quot; BlazeDS message destinations to be able to push messages from your Java code to any interested Flex clients.

Cheers,
Jeremy</description>
		<content:encoded><![CDATA[<p>Jettro,</p>
<p>Great post!  Like Mark said, I definitely think you&#8217;ll like the messaging support we&#8217;ve been working on for the upcoming RC1&#8230;makes this much easier.  Another thing worth pointing out is that when I read your requirements, it made me think, &#8220;Why do we need JMS at all for something simple like this?&#8221;.  It&#8217;s the same thought I had when working on some examples, and so we&#8217;ve also added an even simpler MessageTemplate that uses the &#8220;native&#8221; BlazeDS message destinations to be able to push messages from your Java code to any interested Flex clients.</p>
<p>Cheers,<br />
Jeremy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RogerV</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21248</link>
		<dc:creator>RogerV</dc:creator>
		<pubDate>Tue, 14 Apr 2009 07:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21248</guid>
		<description>Have had an application out since mid last year that&#039;s using this same stack. Works quite well - other than had to figure out work-arounds for a few ActiveMQ problems (in it&#039;s core message broker behavior - not the integration stuff with Spring and BlazeDS).

But it&#039;s all good now.</description>
		<content:encoded><![CDATA[<p>Have had an application out since mid last year that&#8217;s using this same stack. Works quite well &#8211; other than had to figure out work-arounds for a few ActiveMQ problems (in it&#8217;s core message broker behavior &#8211; not the integration stuff with Spring and BlazeDS).</p>
<p>But it&#8217;s all good now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Fisher</title>
		<link>http://www.gridshore.nl/2009/04/13/doing-flex-with-jms-combining-blazeds-spring-jms-and-activemq/comment-page-1/#comment-21241</link>
		<dc:creator>Mark Fisher</dc:creator>
		<pubDate>Mon, 13 Apr 2009 22:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.gridshore.nl/?p=744#comment-21241</guid>
		<description>I think you will be pleased with the next Spring BlazeDS Integration release. In fact, the new JmsAdapter is available in SVN already. There is even namespace support. Basically, you can remove all of the JMS configuration you have above including the JNDI configuration. Instead, you will be able to do something like this:
   
   &lt;jms-message-destination id=&quot;fromJms&quot; queue-name=&quot;toFlex&quot;/&gt;

It will look for a &quot;connectionFactory&quot; bean name within the Spring configuration. Otherwise, you could add that attribute as well. And, if you prefer to reference a Spring-configured JMS Destination instance, you can replace &#039;queue-name&#039; above with &#039;jms-destination-ref&#039; instead.

Please try it out and let us know what you think. I&#039;ll be looking forward to the next post ;)

Regards,
Mark</description>
		<content:encoded><![CDATA[<p>I think you will be pleased with the next Spring BlazeDS Integration release. In fact, the new JmsAdapter is available in SVN already. There is even namespace support. Basically, you can remove all of the JMS configuration you have above including the JNDI configuration. Instead, you will be able to do something like this:</p>
<p>   &lt;jms-message-destination id=&#8221;fromJms&#8221; queue-name=&#8221;toFlex&#8221;/&gt;</p>
<p>It will look for a &#8220;connectionFactory&#8221; bean name within the Spring configuration. Otherwise, you could add that attribute as well. And, if you prefer to reference a Spring-configured JMS Destination instance, you can replace &#8216;queue-name&#8217; above with &#8216;jms-destination-ref&#8217; instead.</p>
<p>Please try it out and let us know what you think. I&#8217;ll be looking forward to the next post <img src='http://www.gridshore.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Regards,<br />
Mark</p>
]]></content:encoded>
	</item>
</channel>
</rss>

