Comments (9)
It's generally up to applications to set and decide how to interpret message content type. @acogoluegnes thoughts?
from rabbitmq-jms-client.
@amitkapps I understand text/plain
would make more sense for TextMessage
s, but as @michaelklishin suggested, applications should set and interpret the content type. Does it make sense the JMS client sets text/plain
while the message actually carries JSON?
The sending application could set the content type on the JMS message:
TextMessage msg = session.createTextMessage("Hello world");
msg.setStringProperty("content-type", "text/plain");
An AMQP receiver could then get the content type from the headers:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
properties.getHeaders().get("content-type");
}
from rabbitmq-jms-client.
The JSON point is a very good one. I don't think we should do it.
from rabbitmq-jms-client.
@acogoluegnes @michaelklishin thanks for the feedback.
This would work, however it requires changes both on the client jms side as well as, say, an amqp receiver.
Currently, if I were to set the stringProperty content-type text/plain on the jms producer side, it would not make the amqp consumer think its a text messages since the contentType property on the amqp message is always being hardcoded as application/octet-stream.
It would help with jms > ampq interoperability. Otherwise you're forced to handle that differently on the consumer side, whereas the amqp spec already provides first class support for MIME types with basic.content-type property string.
from rabbitmq-jms-client.
Unfortunately we cannot assume that every TextMessage
actually contains text (and not a text-based encoded values as in the JSON example above).
from rabbitmq-jms-client.
How about some ability to transparently map a set of incoming jms headers to amqp headers.
Case in point- if a jms header String property comes in as content-type that could get mapped to the equivalent AMQP header.
A similar strategy could possibly also apply to other header properties as well.
from rabbitmq-jms-client.
This is not a venue for discussions. Smarter is not always better when it comes to libraries. Just set the damn field.
from rabbitmq-jms-client.
Not meant for discussions really?
great argument. Moving on....
from rabbitmq-jms-client.
@amitkapps yes, really. Discussions belong to the mailing list. That's how our team operates, whether you like it or not. Sorry not sorry.
from rabbitmq-jms-client.
Related Issues (20)
- Implement JMS 2.0 body extraction methods
- Add JMS 2.0 new methods to create a session (JMS_SPEC-45)
- Add new createDurableConsumer JMS 2.0 methods (JMS_SPEC-51)
- Make JMSXDeliveryCount mandatory
- Add flag to enable subscription name validation
- Activate subscription name validation
- Deprecate ConfirmListener in favor of JMS 2.0 asynchronous send
- Support JMS 2.0 asynchronous send HOT 1
- Remove ConfirmListener
- Add support for shared topic subscriptions HOT 1
- Implement JMS 2.0 simplified API
- Bump dependencies
- Bump dependencies
- Support delivery delay
- Support for Queue Selectors
- Request new parameter `nackOnRollback` in `RMQConnectionFactory#createConnectionFactory` HOT 2
- NPE if a received message is marked as "Redelivered" but no header is given HOT 2
- Expose setSaslConfig() on RMQConnectionFactory for supporting Mutual TLS HOT 3
- Bump dependencies
- Bump dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rabbitmq-jms-client.