Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 39

Thread: jms-source cannot be configured with a jms-template

  1. #21

    Default JTA by default maybe

    No , Im not using JTA ..its being used by default <thru spring> somehow..
    Here is my config in whole :
    Code:
    <message-bus auto-create-channels="true" error-channel="errorChannelRequest"/>
    
    <channel id="FMSRequestChannel"/>
    	 
       	<!-- JMS Source (request queue) --> 
    <jms-source id="wmqConsumer1" 
    	connection-factory="connectionFactoryWMQ_IFT_FMS" 
    	destination-name="1GFP.IFT.PAYMENT.501.REQUEST" 
    	channel="FMSRequestChannel"/>
    	
    <endpoint input-channel="FMSRequestChannel"
    		  handler-ref="fmsListener"
    	          handler-method="onMessage"/>
    
    	<!-- WebSphere connection factory -->
        <beans:bean id="connectionFactoryWMQ_IFT_FMS" class="com.ibm.mq.jms.MQQueueConnectionFactory">
            <beans:property name="queueManager" value="QMLD001A" />
            <beans:property name="transportType" value="1" />
            <beans:property name="hostName" value="eis-qmld001-01.usa.net" />
            <beans:property name="channel" value="1GFP.CLIENT2" /><!-- 1SWF.CLIENT2 -->
            <beans:property name="port" value="60001" />
        </beans:bean>			
        
        <!-- Reply message Listener 	DO NOT MODIFY THIS -->
        <beans:bean id="fmsListener" class="com.cib.gfits.frameworks.handler.reply.ReplyHandler" >	
        </beans:bean >
        
    	<!-- Error handling DO NOT MODIFY THIS -->
    	<channel id="errorChannelRequest" publish-subscribe="true" capacity="500"/> 
    	<endpoint input-channel="errorChannelRequest"
    	          default-output-channel="outputChannel"
    	          handler-ref="errorHandlerRequest"
    	          handler-method="logError"/>
    	          
    <beans:bean id="errorHandlerRequest" class="com.cib.gfits.frameworks.handler.error.ErrorHandler"/>
    There is no where that I specify the Tx Manager. One thing I would like to point out is that I am testing this thru standalone junit class, if it makes any difference.

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

    Default

    I have added a configurable "acknowledge" attribute in the XML for <jms-source/> which accepts the same enumerated values as a Spring JMS listener container: auto, client, dups-ok, transacted. For now, the default is consistent with listener-container (auto) rather than "transacted" as it was previously. This may change, but in any case, you can now configure "auto" (not typically recommended) or "client", etc.

    Note that all adapters have now been moved to a separate "spring-integration-adapters" project, so if you checkout via SVN, look for "spring-integration-adapters" (and add the corresponding JAR file to your dependencies).

    Enabling adapter support in the namespace requires a minor change in the "schemaLocation" (notice spring-integration-adapters-1.0.xsd):
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <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"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            http://www.springframework.org/schema/integration
            http://www.springframework.org/schema/integration/spring-integration-adapters-1.0.xsd">

  3. #23
    Join Date
    Jan 2008
    Posts
    16

    Default

    Mark,
    I tried to use the message-converter property of jms-source but my converter is never invoked.

    Xml snippet
    Code:
     <jms-source id="jms-src"  
    		connection-factory="connectionFactoryWMQ" 
    		destination-name="${wmq.reply.destination.name}" 
    		channel="RequestChannel" acknowledge="auto" message-converter="mc" />
    <beans:bean id="mc" class="com.test.RequestMessageConverter">		</beans:bean>

    Any idea what is going wrong here?

    basically, I am trying to acknowledge the message using the converter but converter itself is not getting called.

    Any help will be appreciated
    Thanks in advance.
    Vikas

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

    Default

    If you want to explicitly acknowledge, you should be setting the "acknowledge" attribute's value to "client" rather than "auto".

    Have you attempted to verify (with a breakpoint, printout, etc.) that the MessageConverter is actually being invoked (it should be)?

    -Mark

  5. #25
    Join Date
    Jan 2008
    Posts
    16

    Default

    Apologies..for that mistake, i made it auto to remove message from queue.
    Yes i tried to debug it but it never got call.
    Another observation was it does auto acknowledge even with client value.
    It never acknowledges when i set it to transacted.

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

    Default

    Can you turn on DEBUG level logging? You should see messages from the underlying listener container with information about the Session (whether it's transactional or not, etc.)

    -Mark

  7. #27
    Join Date
    Jan 2008
    Posts
    16

    Default

    I tried to debug the spring code and found that I need to fromMessage is called thus i need override the following method.
    Code:
    	public Object fromMessage(Message message) throws JMSException,MessageConversionException
    However i am still not able to acknowledge the message and why is not "client" mode not working as expected.

    Thanks/Vikas

  8. #28
    Join Date
    Jan 2008
    Posts
    16

    Default

    I tried to set the debugging level but didn't found any information about session can you please point me to spring integration classs which can reveal this the information about session, i can add a breakpoint and check the values.

    After overriding "fromMessage" my converter is getting invoked but acknowledge is not working. Do i need to do anything more here..
    Regards/Vikas

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

    Default

    The logging that you are interested in occurs within "org.springframework.jms.listener.AbstractPollingM essageListenerContainer", so be sure to configure that package for DEBUG level. Spring Integration's JMS source adapter is simply delegating to the underlying support in Spring core.

    As far as the acknowledgment is concerned, keep in mind that if you are running within a transactional session, client or auto have no effect.

    Can you explain a bit more about what you are trying to do with the acknowledgment? It shouldn't be necessary to add a converter just for acknowledging the message. If you use the "client" setting, the Spring listener container will acknowledge as long as the message is received and the listener is invoked successfully.

    -Mark

  10. #30
    Join Date
    Jan 2008
    Posts
    16

    Default

    Thanks for all valuable information.

    I want to acknowledge the message only if i am able to process it. I am writing custom message handler by extending DefaultIncomingMessageHandler. I would to like acknowledge only after doing some processing on the message, this to ensure that unprocessed messages will not be lost. I hope i was able to explain my use case.

    I was not able to figure out the about trasacted state. I could see following logs which look relevant but dont give any information.

    2008-04-09 16:51:30,905 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] Found bean property 'sessionAcknowledgeMode' of type [int]
    2008-04-09 16:51:30,905 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] Found bean property 'sessionAcknowledgeModeName' of type [java.lang.String]
    2008-04-09 16:51:30,905 DEBUG [org.springframework.beans.CachedIntrospectionResul ts] Found bean property 'sessionTransacted' of type [boolean]

Posting Permissions

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