[jira] Commented: (SM-744) Request/Response for jms through MessageID/CorrelationID
[ https://issues.apache.org/activemq/browse/SM-744?page=comments#action_37420 ] Martin Landua commented on SM-744: -- Grant, consider an external client, which sends a request to a servicemix application through jms and expects an answer to some reply queue, which the client provides. Please note that I am talking about an external client, not another servicemix application. Now, one option for the client is to provide a correlation id that it expects to be returned with the response. That is one pattern, which also servicemix uses as you correctly pointed out in MultiplexingProviderProcessor(161) and StandardProviderProcessor(101). Everything is fine for this scenario. Another pattern could be that the client does not create an arbitrary correlation id but instead it expects servicemix to return the message id of the jms request message (not any exchange id) to be returned as the correlation id in the response jms message. Actually we do have a client which relies on this behavior. Currently, servicemix does not support that and I was thinking to add this as a configurable feature. Hope this clarifies my question. Best regards Martin > Request/Response for jms through MessageID/CorrelationID > > > Key: SM-744 > URL: https://issues.apache.org/activemq/browse/SM-744 > Project: ServiceMix > Issue Type: Improvement > Components: servicemix-jms > Environment: All platforms >Reporter: Martin Landua >Priority: Minor > > The servicemix-jms component assumes that the request/reponse pattern is > implemented by the client by using some artificial correlation id as the > "connection" between the messages (as described in > http://activemq.org/site/how-should-i-implement-request-response-with-jms.html). > However, there are cases where the client assumes that the server sets the > correlation id of the response to the message id (!) of the request. > Currently, the servicemix-jms component does not support this, but it would > be convenient if it were configurable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SM-744) Request/Response for jms through MessageID/CorrelationID
[ https://issues.apache.org/activemq/browse/SM-744?page=comments#action_37421 ] Martin Landua commented on SM-744: -- Grant, please find enclosed the diff, which might illustrate how I would think it could work: Index: ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java === --- ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java (revision 472981) +++ ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/standard/StandardConsumerProcessor.java (working copy) @@ -123,7 +123,11 @@ response = fromNMSResponse(exchange, context, session); if (response != null) { producer = session.createProducer(message.getJMSReplyTo()); - response.setJMSCorrelationID(message.getJMSCorrelationID()); +if (endpoint.isUseMsgIdInResponse()) { + response.setJMSCorrelationID(message.getJMSMessageID()); +} else { + response.setJMSCorrelationID(message.getJMSCorrelationID()); +} producer.send(response); } } finally { Index: ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java === --- ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java (revision 472981) +++ ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/multiplexing/MultiplexingConsumerProcessor.java (working copy) @@ -109,7 +109,11 @@ response = fromNMSResponse(exchange, context, session); if (response != null) { producer = session.createProducer(message.getJMSReplyTo()); -response.setJMSCorrelationID(message.getJMSCorrelationID()); +if (endpoint.isUseMsgIdInResponse()) { +response.setJMSCorrelationID(message.getJMSMessageID()); +} else { + response.setJMSCorrelationID(message.getJMSCorrelationID()); +} producer.send(response); } } finally { Index: ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java === --- ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java (revision 472981) +++ ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/JmsEndpoint.java (working copy) @@ -56,6 +56,8 @@ protected String jndiConnectionFactoryName; protected String jndiDestinationName; protected String jmsProviderDestinationName; + +protected boolean useMsgIdInResponse; // // Spring configuration // @@ -458,4 +460,17 @@ return component.getKeystoreManager(); } +/** + * Determines whether for a request/response pattern, the message id of the request message + * should be used as the correlation id in the response or the correlation id of the request. + * @return + */ +public boolean isUseMsgIdInResponse() { +return useMsgIdInResponse; +} + +public void setUseMsgIdInResponse(boolean useMsgIdInResponse) { +this.useMsgIdInResponse = useMsgIdInResponse; +} + } \ No newline at end of file Index: ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java === --- ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java (revision 472981) +++ ./ServiceMix-SNAPSHOT/deployables/bindingcomponents/servicemix-jms/src/main/java/org/apache/servicemix/jms/jca/JcaConsumerProcessor.java (working copy) @@ -138,7 +138,11 @@ response = fromNMSResponse(exchange, context, session); if (response != null) { MessageProducer producer = session.createProducer(message.getJMSReplyTo()); -response.setJMSCorrelationID(message.getJMSCorrelationID()); +if (endpoint.isUseMsgIdInResponse()) { +response.setJMSCorrelationID(message.getJMSMessageID()); +
[jira] Updated: (SM-744) Request/Response for jms through MessageID/CorrelationID
[ https://issues.apache.org/activemq/browse/SM-744?page=all ] Martin Landua updated SM-744: - Attachment: servicemix-jms-patch > Request/Response for jms through MessageID/CorrelationID > > > Key: SM-744 > URL: https://issues.apache.org/activemq/browse/SM-744 > Project: ServiceMix > Issue Type: Improvement > Components: servicemix-jms > Environment: All platforms >Reporter: Martin Landua >Priority: Minor > Attachments: servicemix-jms-patch > > > The servicemix-jms component assumes that the request/reponse pattern is > implemented by the client by using some artificial correlation id as the > "connection" between the messages (as described in > http://activemq.org/site/how-should-i-implement-request-response-with-jms.html). > However, there are cases where the client assumes that the server sets the > correlation id of the response to the message id (!) of the request. > Currently, the servicemix-jms component does not support this, but it would > be convenient if it were configurable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SM-744) Request/Response for jms through MessageID/CorrelationID
[ https://issues.apache.org/activemq/browse/SM-744?page=comments#action_37428 ] Martin Landua commented on SM-744: -- You are right, this would be a static configuration, but the client in fact would not expect the server's behavior to change at runtime. I attached a patch for this issue. Regards Martin > Request/Response for jms through MessageID/CorrelationID > > > Key: SM-744 > URL: https://issues.apache.org/activemq/browse/SM-744 > Project: ServiceMix > Issue Type: Improvement > Components: servicemix-jms > Environment: All platforms >Reporter: Martin Landua >Priority: Minor > Attachments: servicemix-jms-patch > > > The servicemix-jms component assumes that the request/reponse pattern is > implemented by the client by using some artificial correlation id as the > "connection" between the messages (as described in > http://activemq.org/site/how-should-i-implement-request-response-with-jms.html). > However, there are cases where the client assumes that the server sets the > correlation id of the response to the message id (!) of the request. > Currently, the servicemix-jms component does not support this, but it would > be convenient if it were configurable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (SM-750) ClientFactory should implement java.io.Serializable
ClientFactory should implement java.io.Serializable --- Key: SM-750 URL: https://issues.apache.org/activemq/browse/SM-750 Project: ServiceMix Issue Type: Bug Components: servicemix-core Environment: All, especially when running under the JBoss Deployer Reporter: Martin Landua Priority: Minor The object ClientFactory should implement the interface java.io.Serializable. Otherwise, the JBoss Deployer throws an error when trying to register the object in the JBoss JNDI directory. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (SM-981) Transaction Exception due to ServiceMix JMS Provider
Transaction Exception due to ServiceMix JMS Provider Key: SM-981 URL: https://issues.apache.org/activemq/browse/SM-981 Project: ServiceMix Issue Type: Bug Components: servicemix-jms Affects Versions: 3.1 Environment: All platforms. The bug was encountered on ServiceMix 3.1 running in JBoss against JBossMQ. Reporter: Martin Landua Fix For: 3.2 Attachments: servicemix-jms.patch Hi all, under heavy load, we have encountered a problem when writing messages using the JMS provider in a synchronous, transactional flow. The problem is that in the code (lines 100 and up) producer.send(msg); exchange.setStatus(ExchangeStatus.DONE); channel.send(exchange); } finally { if (session != null) { session.close(); } if (connection != null) { connection.close(); } } it is possible that the DONE state would return to the originator faster than the session and the connection is closed in the finally section. If this happens, the originator (and therefore owner of the transaction) will first commit and after this the provider would close the connection. This results in a transaction exception. >From what we can tell, it should read like this: producer.send(msg); } finally { if (session != null) { session.close(); } if (connection != null) { connection.close(); } } exchange.setStatus(ExchangeStatus.DONE); channel.send(exchange); due to which we guarantee that the connection is safely closed before we send the confirmation back to the consumer. All of our load tests succeeded after this change. Best regards Martin Landua -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (SM-1099) EPI Content Enricher may not work if input content is a stream
EPI Content Enricher may not work if input content is a stream -- Key: SM-1099 URL: https://issues.apache.org/activemq/browse/SM-1099 Project: ServiceMix Issue Type: Bug Components: servicemix-eip Affects Versions: 3.1 Environment: Everywhere Reporter: Martin Landua Attachments: servicemix-eip-patch-20071010.txt If a normalized message that carries a stream is being sent to a content enricher endpoint the stream may no longer be readable for combining after calling the target, if the target has read the stream. Obviously, a stream cannot be read more than once. Since the content enricher relies on the fact that the input content is an XML document, we find it appropriate to turn any source input into a dom first before sending the message to the target. Would you please kindly consider the patch that we have attached. Best Regards Martin Landua -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (SM-1101) Copy Properties and Attachments in ContentEnricher EIP endpoint
Copy Properties and Attachments in ContentEnricher EIP endpoint --- Key: SM-1101 URL: https://issues.apache.org/activemq/browse/SM-1101 Project: ServiceMix Issue Type: Bug Components: servicemix-eip Affects Versions: 3.1 Environment: Everywhere Reporter: Martin Landua Attachments: servicemix-eip-patch-20071010-1.txt A message that is sent through the Content Enricher endpoint looses its properties and attachments after the merge. We would like to suggest the enclosed patch. Just for curiosity, there are no "copyattachments" and "copyproperties" attributes on the EIP endpoint base class. Maybe it would be a good idea to add them to make the feature configurable. Best regards Martin Landua -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.