Results 1 to 9 of 9

Thread: Configuring JMS Topic using Spring Integration

  1. #1

    Default Configuring JMS Topic using Spring Integration

    Hi,

    Can someone please provide me some samples on how to configure JMS Topic using Spring integration? I want to publish a message in a topic and have multiple subscribers listen to that topic and consume the message.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    What do you need help with, there's no difference configuration-wise, just wire in a topic Destination. If you want/need a durable subscription, be sure to set the subscription-durable and durable-subscription-name attributes.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jan 2013
    Location
    Edison, New Jersey
    Posts
    7

    Default

    Can you please advise me the steps involved in making the message driven adapter for Tibco EMS topic?
    I am having the following defintion but it's not working.
    <bean id="emsConnectionFactory" class="com.tibco.tibjms.TibjmsTopicConnectionFacto ry"
    p:serverUrl="server url"
    p:userName="username"
    p:userPassword="password">
    </bean>
    <bean id="cachedConnectionFactory" class="org.springframework.jms.connection.CachingC onnectionFactory"
    p:targetConnectionFactory="emsConnectionFactory"
    p:targetConnectionFactory-ref="emsConnectionFactory"
    p:sessionCacheSize="1">
    </bean>
    <bean id="jmsListener" class="org.springframework.jms.listener.DefaultMes sageListenerContainer"
    p:connectionFactory="cachedConnectionFactory"
    p:connectionFactory-ref="cachedConnectionFactory"
    p:destinationName="ESM Topic Namme"
    pubSubDomain="true"
    p:autoStartup="false">
    </bean>
    <jms:message-driven-channel-adapter id="jmsIn"
    connection-factory="emsConnectionFactory"
    destination="EMS Topic Name"
    channel="exampleChannel"/>

    I am getting the following error
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.integration.jms.ChannelPublis hingJmsMessageListener#0': Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcept ion
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:609)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:469)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at com.barcap.ocs.scheduling.main.Bootstrap.main(Boot strap.java:15)

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Please do not post the same message multiple times in the forum. Also, please use [ CODE ] [ /CODE ] (without the spaces) around configuration and code excerpts.

    Most likely your problem is due to a version conflict on the classpath. Please check that first.

  5. #5
    Join Date
    Jan 2013
    Location
    Edison, New Jersey
    Posts
    7

    Default

    Hi Mark, Thanks for the reply.
    Can you tell me more about the conflict. How do i check the class path conflict?

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    You might have multiple versions of a given JAR file.

  7. #7
    Join Date
    Jan 2013
    Location
    Edison, New Jersey
    Posts
    7

    Default

    Any Specific Jar ? I am using pretty much everything latest.
    [CODE]
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:integration="http://www.springframework.org/schema/integration"
    xmlns:jms="http://www.springframework.org/schema/integration/jms"
    xmlns="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:stream="http://www.springframework.org/schema/integration/stream"
    xmlns:si-xml="http://www.springframework.org/schema/integration/xml"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/integration
    http://www.springframework.org/schema/integration/spring-integration-2.2.xsd
    http://www.springframework.org/schema/integration/jms
    http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.2.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/integration/stream
    http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.2.xsd
    http://www.springframework.org/schema/integration/xml
    http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.2.xsd">

  8. #8
    Join Date
    Jul 2012
    Posts
    5

    Default jms topic fix

    Quote Originally Posted by Mark Fisher View Post
    You might have multiple versions of a given JAR file.
    http://stackoverflow.com/questions/3...rizedtypeexcep


    http://forum.springsource.org/showth...estion-sos!!!I have to agree with mark fisher.
    Make sure you are using the right jar file....

  9. #9
    Join Date
    Jan 2013
    Location
    Edison, New Jersey
    Posts
    7

    Default

    Yes Mark, you are right.

    The issue was because of the version conflict between two jars. Spring 2.5.1 and Spring.2.5.6. I changed to use the Spring.2.5.1 and it works now. service is getting triggered based on the message driven channel adapater.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •