cancel
Showing results for 
Search instead for 
Did you mean: 

JMS adapter Rabbit MQ content_type: application/octet-stream

mlingbeek
Explorer
0 Kudos

Hi,

In my Idoc ->PI -> JMS RabbitMQ scenario I receive a message in Rabbit MQ with content_type: application/octet-stream.

The receiver party wants an application/xml as content_type.

How can I set the receiver JMS adapter to achieve this.

Message was edited by: Meinhart Lingbeek I succedded to change the header of the JMS message by configure in the ASMA the specific additional : with for example : Content_type : with in the Module tab :

Accepted Solutions (1)

Accepted Solutions (1)

former_member204100
Active Participant
0 Kudos

Hi Meinhart,

you can also use the MessageTransformBean in the module processor with the following parameter set: Transform.ContentType  - application/xml

Please also read this documentation :

Inserting MessageTransformBean in Module Processor - SAP NetWeaver Process Integration - SAP Library

Best Regards,

Viktor

mlingbeek
Explorer
0 Kudos

I tried that option. the content_type of the document stays application/octet-stream.

The current configuartion is :

I have to use the number 3 and 4. As soon the message turns Binary the content type is transformed to octet.

Question stays: How can I change the property content_type.

Thanks

for your respond.

vadimklimov
Active Contributor
0 Kudos

Hello Meinhart and Viktor,

I don't think it is possible to overwrite or adjust message content_type from adapter / adapter modules level. I looked into JMS library provided for RabbitMQ, and there found a class that is used to generate AMQP/JMS messages (RMQMessageProducer). Having fast look into its implementation, observations drive me to a conclusion content_type is hard-coded and is not propagated from any configuration parameter:

There is a header property 'contentType' (also seen on your screenshot with value assigned 'application/xml' following configuration of the communication channel) that you may make use of in a consumer application when processing the message and verifying what kind of content is contained in it. Will that be feasible for the consumer?

Regards,

Vadim

mlingbeek
Explorer
0 Kudos

Thanks Vadim,

I put in the contentType myself in the header of the message.

And I will ask if the reciving party can obtain that field from the header and use it.

Do you have another suggestion.

regards meinhart

vadimklimov
Active Contributor
0 Kudos

Hi Meinhart,

If the consumer application needs to check content type, then, in my opinion, solution suggested above would be probably the most straightforward and transparent since the message will contain required content type in its header that can be used by a consumer (and that can be flexibly configured and set in PI). Or do you have any concerns regarding its applicability to your particular scenario?

Regards,

Vadim

mlingbeek
Explorer
0 Kudos

Hi Vadim,

Thank you for your help. The receiver party must handle the content_type.

Regards Meinhart

Answers (0)