Comments (8)
@mcgiri Here's a workaround: #19 (comment)
from rabbitmq-jms-client.
There's no standard content type header in JMS. The best we can do is to provide an interface to customize the AMQP.BasicProperties.Builder
:
public interface AmqpPropertiesCustomizer {
AMQP.BasicProperties.Builder customize(AMQP.BasicProperties.Builder builder, Message jmsMessage);
}
Your implementation could be the following:
public class ContentTypeAmqpPropertiesCustomizer implements AmqpPropertiesCustomizer {
public AMQP.BasicProperties.Builder customize(AMQP.BasicProperties.Builder builder, Message jmsMessage) {
String contentType = jmsMessage.getStringProperty("content_type");
if (contentType != null) {
builder.contentType(contentType);
}
return builder;
}
}
The customizer instance would be set at the RMQConnectionFactory
level. @mcgiri Would that work for you?
from rabbitmq-jms-client.
@acogoluegnes -- Apologies, i am going to take couple of days to get back since I am calling it from an app which uses native JMS methods, and I need to look at options to use the interface. I guess it should work but let me come back.
from rabbitmq-jms-client.
@acogoluegnes -- Even with the interface, the content_type would still be set to "application/octet-stream" right? Is there a way to not set it at all?
from rabbitmq-jms-client.
As far as I can tell, that is the case. It's certainly possible to have that field blank in the underlying Java client, though.
from rabbitmq-jms-client.
@mcgiri The customizer would be applied after, so it could override the previous value of content_type
.
from rabbitmq-jms-client.
@acogoluegnes Can you please include the interface? I should be able to use it. Sorry for the delay again. Thanks!
from rabbitmq-jms-client.
@mcgiri 1.9.0.RC1 has shipped with this feature, you can give it a try.
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.