Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

gigaspaces with jms

Hi everybody,

I worked on application using jms and mysql. But now I use gigaspace instead of using mysql and I want to use jms with gigaspace.

I saw [ http://www.gigaspaces.com/wiki/displa... ] and in my application I use the messaging type => point to point.

Can you help me please? You'll find my code in attach files.

Carole h4. Attachments


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2439]{quote}

asked 2008-07-04 05:30:35 -0500

cbe gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

A better and simpler option for stetting JMS would be to use the Spring JMSTemplate.

You can find an example of how to set this up in the OpenSpaces DataExample

You can see the code example of JMS feeder here

See below a snippet on how you set the JMS configuration using Spring template:

<bean id="jmsDataFeeder" class="org.openspaces.example.data.feeder.JMSDataFeeder">
    <property name="instanceId" value="${clusterInfo.instanceId}" />
    <property name="numberOfTypes" value="${numberOfTypes}" />
    <property name="jmsTemplate" ref="jmsTemplate" />

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="defaultDestination" ref="destination" />

<os-jms:queue id="destination" name="MyQueue" />

Your feeder will look something along the following lines:

public class JMSDataFeeder implements InitializingBean, DisposableBean {
    Data data = new Data(Data.TYPEScounter+ % Data.TYPES.length, "FEEDER " + Long.toString(time));
    jmsTemplate.send(new MessageCreator() {
        public Message createMessage(Session session) throws JMSException {
            return session.createObjectMessage(data);

Nati S.

answered 2008-07-04 07:05:12 -0500

natis gravatar image
edit flag offensive delete link more



I'm trainee and my internship supervisor doesn't want to use Spring.


cbe gravatar imagecbe ( 2008-07-04 07:20:39 -0500 )edit

Carole It isn't about Spring its about configuration and this how we setup configuration in GigaSpaces. Spring is an implementation detail on that regard. You don't need to know Spring to use our OpenSpaces framework - you just need to follow the reference and instruction in the documentation like you would do with any other style of XML and Annotation based configuration.

Nati S.

natis gravatar imagenatis ( 2008-07-04 11:46:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-07-04 05:30:35 -0500

Seen: 75 times

Last updated: Jul 04 '08