You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by liucong <li...@gmail.com> on 2009/07/25 07:37:22 UTC

How to generate the CorrelationID in the client in jms transport?

Hi,

I'm very confused with the CorrelationID which is generated by the
jms-transport.

The configuration piece as follows:
<service name="HelloWorldServiceRuntimeCorrelationIDStaticPrefix">
<port binding="tns:HelloWorldPortBinding"
name="HelloWorldPortRuntimeCorrelationIDStaticPrefixEng">
<jms:clientConfig conduitSelectorPrefix="com.mycompany.eng:"
useConduitIdSelector="true"/>
<jms:server messageSelector="JMSCorrelationID LIKE 'com.mycompany.eng:%'"/>
<jms:address
...
</jms:address>
</port>
</service>

I think the rules generating the CorrelationID should be as follows:

userCID -> userCID
userCID + conduitSelectorPrefix -> userCID
userCID + conduitSelectorPrefix + useConduitIdSelector(true) -> userCID
userCID + conduitSelectorPrefix + useConduitIdSelector(false) -> userCID

conduitSelectorPrefix + useConduitIdSelector(true) ->
conduitSelectorPrefix + conduitId + index
conduitSelectorPrefix + useConduitIdSelector(false) ->
conduitSelectorPrefix + index

useConduitIdSelector(true) -> conduitId + index
useConduitIdSelector(false) -> the request message's messageID

->'s left side is the condition.
->'s right side is rule for generation of CorrelationID.
userCID means that the client gives a CorrelationID.
conduitSelectorPrefix means that the client configures in the wsdl.
useConduitIdSelector means that the client configures in the wsdl.
conduitId means that the string generated by the jms-tranport's JMSConduit.
index is a autoincreasing number which indicates the uniqueness of the
CorrelationID.


Is it right?
I want to use this rules for the generation of CorrelationID.

best regards

Re: How to generate the CorrelationID in the client in jms transport?

Posted by liucong <li...@gmail.com>.
Hi

Willem Jiang wrote:
> Hi,
>
> You can choice what you want to generate the correlationID, and you
> just need to make sure the CorrelationID is unique.
>
> In you proposal, you give the user a choice to set the correlationID
> from the JMSMessageHeader which he set, it's OK for me.
> For the useConduitIdSelector, it's just for the client side to choice if
> it uses the MessageID pattern or CorrelationID pattern.
>
>   
useConduitIdSelector is just one of the three
condition(userCID==null,conduitSelectorPrefix==null,
useConduitIdSelector == false) for using MessageID pattern.
> There is not a clear definition on the server side, such as if server
> side is set to use MessageID pattern , it will ignore the
> CorrelationID which is already set on the request JMS message header to
> generation the response message CorrelationID.
> So I think we need add this server side definition as while.
>
>   

I think the messageId or Correlation ID pattern is determined by the
client. On the server side, if the JMSMessage's CorrelationID is not
null, we use CorrelationID pattern, if not, we use MessageID pattern.
The current implement uses this rule.
> BTW,  we need to add some documents for use about it CorrelationID
> generation rule on the wiki to make sure every body
> knows what is going on there :)
>
> Any other thoughts?
>
> Willem
>
> liucong wrote:
>   
>> Hi,
>>
>> I'm very confused with the CorrelationID which is generated by the
>> jms-transport.
>>
>> The configuration piece as follows:
>> <service name="HelloWorldServiceRuntimeCorrelationIDStaticPrefix">
>> <port binding="tns:HelloWorldPortBinding"
>> name="HelloWorldPortRuntimeCorrelationIDStaticPrefixEng">
>> <jms:clientConfig conduitSelectorPrefix="com.mycompany.eng:"
>> useConduitIdSelector="true"/>
>> <jms:server messageSelector="JMSCorrelationID LIKE 'com.mycompany.eng:%'"/>
>> <jms:address
>> ...
>> </jms:address>
>> </port>
>> </service>
>>
>> I think the rules generating the CorrelationID should be as follows:
>>
>> userCID -> userCID
>> userCID + conduitSelectorPrefix -> userCID
>> userCID + conduitSelectorPrefix + useConduitIdSelector(true) -> userCID
>> userCID + conduitSelectorPrefix + useConduitIdSelector(false) -> userCID
>>
>> conduitSelectorPrefix + useConduitIdSelector(true) ->
>> conduitSelectorPrefix + conduitId + index
>> conduitSelectorPrefix + useConduitIdSelector(false) ->
>> conduitSelectorPrefix + index
>>
>> useConduitIdSelector(true) -> conduitId + index
>> useConduitIdSelector(false) -> the request message's messageID
>>
>> ->'s left side is the condition.
>> ->'s right side is rule for generation of CorrelationID.
>> userCID means that the client gives a CorrelationID.
>> conduitSelectorPrefix means that the client configures in the wsdl.
>> useConduitIdSelector means that the client configures in the wsdl.
>> conduitId means that the string generated by the jms-tranport's JMSConduit.
>> index is a autoincreasing number which indicates the uniqueness of the
>> CorrelationID.
>>
>>
>> Is it right?
>> I want to use this rules for the generation of CorrelationID.
>>
>> best regards
>>
>>     
>
>
>   


Re: How to generate the CorrelationID in the client in jms transport?

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can choice what you want to generate the correlationID, and you
just need to make sure the CorrelationID is unique.

In you proposal, you give the user a choice to set the correlationID
from the JMSMessageHeader which he set, it's OK for me.
For the useConduitIdSelector, it's just for the client side to choice if
it uses the MessageID pattern or CorrelationID pattern.

There is not a clear definition on the server side, such as if server
side is set to use MessageID pattern , it will ignore the
CorrelationID which is already set on the request JMS message header to
generation the response message CorrelationID.
So I think we need add this server side definition as while.

BTW,  we need to add some documents for use about it CorrelationID
generation rule on the wiki to make sure every body
knows what is going on there :)

Any other thoughts?

Willem

liucong wrote:
> Hi,
> 
> I'm very confused with the CorrelationID which is generated by the
> jms-transport.
> 
> The configuration piece as follows:
> <service name="HelloWorldServiceRuntimeCorrelationIDStaticPrefix">
> <port binding="tns:HelloWorldPortBinding"
> name="HelloWorldPortRuntimeCorrelationIDStaticPrefixEng">
> <jms:clientConfig conduitSelectorPrefix="com.mycompany.eng:"
> useConduitIdSelector="true"/>
> <jms:server messageSelector="JMSCorrelationID LIKE 'com.mycompany.eng:%'"/>
> <jms:address
> ...
> </jms:address>
> </port>
> </service>
> 
> I think the rules generating the CorrelationID should be as follows:
> 
> userCID -> userCID
> userCID + conduitSelectorPrefix -> userCID
> userCID + conduitSelectorPrefix + useConduitIdSelector(true) -> userCID
> userCID + conduitSelectorPrefix + useConduitIdSelector(false) -> userCID
> 
> conduitSelectorPrefix + useConduitIdSelector(true) ->
> conduitSelectorPrefix + conduitId + index
> conduitSelectorPrefix + useConduitIdSelector(false) ->
> conduitSelectorPrefix + index
> 
> useConduitIdSelector(true) -> conduitId + index
> useConduitIdSelector(false) -> the request message's messageID
> 
> ->'s left side is the condition.
> ->'s right side is rule for generation of CorrelationID.
> userCID means that the client gives a CorrelationID.
> conduitSelectorPrefix means that the client configures in the wsdl.
> useConduitIdSelector means that the client configures in the wsdl.
> conduitId means that the string generated by the jms-tranport's JMSConduit.
> index is a autoincreasing number which indicates the uniqueness of the
> CorrelationID.
> 
> 
> Is it right?
> I want to use this rules for the generation of CorrelationID.
> 
> best regards
>