Results 1 to 9 of 9

Thread: Sending messages TO JMS Queue without Spring JMSTemplate

Hybrid View

  1. #1

    Default Sending messages TO JMS Queue without Spring JMSTemplate

    have a spring based application and I want to initialize a message producer in the spring beans configuration file to send the messages. I cannot use JMS template to send the messages. So i want to initialize a message producer in spring beans file that can be used to send messages. But I cant find any implementation of Messageproducer in Spring 3.x and cant find how to initialize the Message producer through spring beans configuration file. I tried something like this shown below. A part of the configuration file to intialize MessageProducer :-

    <bean id="connection" class="org.springframework.jms.JmsConnectionFactor yBean">
    <property name="connectionFactory"><ref bean="connectionFactory"/></property>
    </bean>

    <bean id="jmsSession" class="org.springframework.jms.JmsSessionFactoryBe an">
    <property name="connection"><ref bean="connection"/></property>
    </bean>

    <bean id="producer" class="org.springframework.jms.JmsProducerFactoryB ean">
    <property name="session"><ref bean="jmsSession"/></property>
    <property name="destination"><ref bean="senderDestination"/></property>
    </bean>
    But these API's are not supported in spring 3.x. Any help would be appreciated.

    Regards

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

    Default

    Can you explain why you can't use JmsTemplate?

  3. #3

    Default

    as per few posts, it is said that production environment where high performance is required, jmstmeplate should not be used as it has some performance issues.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Instead of premature optimization first test the JmsTemplate, I never encountered performance issues with JmsTemplate even in high performance situations. In general it is misuse and misconfiguration that lead to performance issues then the JmsTemplate itself.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

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

    Default

    I also replied on your StackOverflow thread, but will add the same here....

    I think you may be referring to some very old posts that were written before Spring added support for caching resources (sessions, producers, etc). See the CachingConnectionFactory documentation for more details.

    Bottom line: there should be no need to avoid JmsTemplate for performance reasons.

  6. #6

    Default

    I would have to do a POC to show it to my seniors that there is no issue with jmstemplate. For now, i cant use jmstemplate immediately, I would really appreciate if you can help in configuring MessageProducer in spring configuration file

Tags for this Thread

Posting Permissions

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