You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2008/09/18 00:41:44 UTC

[jira] Created: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Use Spring JMSTemplate in JMSConduit instead of direct JMS
----------------------------------------------------------

                 Key: CXF-1806
                 URL: https://issues.apache.org/jira/browse/CXF-1806
             Project: CXF
          Issue Type: Improvement
          Components: Transports
    Affects Versions: 2.1.2
            Reporter: Christian Schneider
             Fix For: 2.1.3


Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider closed CXF-1806.
------------------------------------


> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.0.8, 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.0.9, 2.1.3, 2.2
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633631#action_12633631 ] 

Freeman Fang commented on CXF-1806:
-----------------------------------

Hi Christian,

+1 to use async way for jms transport.
How about use the correlationID to indentifay the request/reponse pair?

Regards
Freeman

> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider updated CXF-1806:
-------------------------------------

    Attachment: CXF-1806.patch

In this patch I completely replaced the JMS API calls with JMSTemplate in JMSConduit. I also introduced a new JMSConfiguration class. This directly contains a JMSTemplate and a JMSListeningContainer. The JMSConduit does not know of the old configuration anymore and instead uses only the new config class.

The JMSConfiguration is built from the old configs like AddressType. So it is fully backwards compatible. A new class JMSOldConfigholder is used to build the new config.

The tests work and I also tested the code with my own project. Still I am not so sure if the new config should directly contain a JMSTemplate. The idea was to be able to simply get a template injected in the spring config but I am not so sure if this is a good idea. 

Another issue with the code in the patch is that it does not cache Consumers and temporary queues for the reply. I am not sure how important this is. See below for my idea how to better solve the possible performance problem.

Please review the patch and give me some feedback about the design. The patch should only be committed if we get positive feedback from one or the other senior developer.

I am thinking about a larger redesign of the JMSConduit. Instead of a blocking receive I would like to use a Listener to receive the replies asynchronously with one ore more threads. For temporary queues this would mean that we only need one queue instead of one queue per pooled session. I could need some feedback if this is a good idea and how to correlate the asynchronously received reply to the right request.


> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633799#action_12633799 ] 

Christian Schneider commented on CXF-1806:
------------------------------------------

I would use the correlation ID to idnetify the pair but my colleague Eduard told me there could be an Interceptor that does the correlation already. So I thought that I perhaps could simply put the reponse in a chain and it is correlated by CXF. If this is not implemented elsewhere I will implement it.

For the jndi case I have already included the folowing code:

            ConnectionFactory connectionFactory = (ConnectionFactory)jt.lookup(connectionFactoryName);
            UserCredentialsConnectionFactoryAdapter uccf = new UserCredentialsConnectionFactoryAdapter();
            uccf.setUsername(userName);
            uccf.setPassword(password);
            uccf.setTargetConnectionFactory(connectionFactory);

            SingleConnectionFactory scf = new SingleConnectionFactory();
            scf.setTargetConnectionFactory(uccf);

So we should already cover the case of a Factory that does not allow username/password config and the caching of the connection. I hope this is what you meant Willem?

If later the configuration is done directly by injecting a JMSTemplate then I would not do anything. In this case I would suggest to simply write a Howto that describes how to do the same as above in a spring config. 


> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CXF-1806:
---------------------------------

    Assignee: Willem Jiang

> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CXF-1806.
-------------------------------

    Resolution: Fixed

Applied the patch into trunk
http://svn.apache.org/viewvc?rev=698460&view=rev

2.1.x
http://svn.apache.org/viewvc?rev=698467&view=rev

2.0.x 
http://svn.apache.org/viewvc?rev=698472&view=rev

> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.0.8, 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634038#action_12634038 ] 

Willem Jiang commented on CXF-1806:
-----------------------------------

cool, the connection factory is  what I concerned. 

Here are some comments for the correlation ID.  AFAIK, I don't think there is an interceptor which correlates the message by using the correlation ID.
 I think the correlation ID is a transport level (physical) thing, and the interceptors are doing some logical  things. eg. correlation ID is useless for the http transport.
We put the all the context staffs in the message or exchange , and don't use any member objects of the interceptor to make sure the interceptor is  thread safe.  It not easy to do the correlation work in the interceptor.



> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633636#action_12633636 ] 

Willem Jiang commented on CXF-1806:
-----------------------------------

Hi Christian,

I agree with you to use the one temporary queue per JMSConduit for the message receiving, we could use use a map to store the correlatedID with the exchange and set the incoming message with this exchange in the JMS transport.

I just went through your patch , I found you removed the cached consumer code by using the Spring JMS Template for message sending and receiving.
Here is a little old article which tells us about the Spring JMS Template's gotchas[1], it shows us why the session pool is needed. 
It could be better if we find a common way to pool the session when we use the Spring JMS Template.

Any thought?

[1] http://www.theserverside.com/news/thread.tss?thread_id=37740

Willem


> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang updated CXF-1806:
------------------------------

    Affects Version/s: 2.0.8
        Fix Version/s: 2.2
                       2.0.9

> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.0.8, 2.1.2
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 2.0.9, 2.1.3, 2.2
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1806) Use Spring JMSTemplate in JMSConduit instead of direct JMS

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider updated CXF-1806:
-------------------------------------

    Attachment: CXF-1806-2.patch

Merged in CXF-1805 from Ulhas Bole

> Use Spring JMSTemplate in JMSConduit instead of direct JMS
> ----------------------------------------------------------
>
>                 Key: CXF-1806
>                 URL: https://issues.apache.org/jira/browse/CXF-1806
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.1.2
>            Reporter: Christian Schneider
>             Fix For: 2.1.3
>
>         Attachments: CXF-1806-2.patch, CXF-1806.patch
>
>
> Using the Spring JMSTemplate has many advantages compared to directly using the JMS API. For example cxf services can participate in Transactions.
> The goal for this issue is to replace JMS API in JMSConduit with JMSTemplate calls. Additionally the JMSConduit should be made more dependency injection friendly. It should not retrieve configuration from the Spring config.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.