Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties set on messages should override those on publisher #26

Closed
michaelklishin opened this issue Jun 11, 2017 · 3 comments
Closed

Comments

@michaelklishin
Copy link
Member

michaelklishin commented Jun 11, 2017

See this rabbitmq-users thread, originally posted as a question in #25.

Doing it the other way around seems odd. I cannot think of a reason for that.

@acogoluegnes @artembilan @garyrussell perhaps you can?

@garyrussell
Copy link
Collaborator

I concur; I would expect the hierarchy to be

  • method argument (in overloaded send())
    • existing message properties
      • producer defaults

However, it's tough to make a behavior change like that in a maintenance release.

We (Spring) typically handle cases like that with a boolean that retains the previous behavior in the current release and switches to the new behavior in the next release.

That avoids breaking existing apps that are leveraging the current behavior.

@michaelklishin
Copy link
Member Author

We can do it in 2.0 or introduce a swappable strategy for property merging.

@acogoluegnes
Copy link
Contributor

acogoluegnes commented Jun 15, 2017

Well, according to the JMS specification, the current behavior is correct, e.g. for JMSPriority:

When a message is sent, this field is ignored. After completion of the send, it holds the value specified by the method sending the message.

And the Javadoc:

This method is for use by JMS providers only to set this field when a message is sent. This message cannot be used by clients to configure the priority level of the message.

Same thing for expiration and delivery mode.

I suggest we keep this behavior as the default one, but provide a flag to switch to the non-compliant but more natural behavior.

cc @michaelklishin @garyrussell @damonsutherland

acogoluegnes added a commit that referenced this issue Jun 15, 2017
Priority, delivery mode, and expiration aren't taken into
account on sending when set in the JMS message. This is compliant with
the specifiation though. This commit provide a flag in
RMQConnectionFactory to make the RMQMessageProducer use the
message properties if set. This is non-compliant with the specification
but more natural. The existing and spec-compliant behavior is still
the default.

Fixes #26
acogoluegnes added a commit that referenced this issue Jun 15, 2017
Priority, delivery mode, and expiration aren't taken into
account on sending when set in the JMS message. This is compliant with
the specifiation though. This commit provide a flag in
RMQConnectionFactory to make the RMQMessageProducer use the
message properties if set. This is non-compliant with the specification
but more natural. The existing and spec-compliant behavior is still
the default.

Fixes #26
@michaelklishin michaelklishin added this to the 1.7.0 milestone Jun 15, 2017
acogoluegnes added a commit that referenced this issue Jun 20, 2017
acogoluegnes added a commit to rabbitmq/rabbitmq-website that referenced this issue Jun 20, 2017
onMessageTimeoutMs: references rabbitmq/rabbitmq-jms-client#5
preferProducerMessageProperty: references rabbitmq/rabbitmq-jms-client#26
requeueOnMessageListenerException: references rabbitmq/rabbitmq-jms-client#23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants