Reputation: 21
It is not sending it because InputStream is not Serializable. Is there any option to do this? Different InputStreams will contain different sources to read from so it's better if I can send InputStream directly to JMS queue.
Upvotes: 0
Views: 1831
Reputation: 12998
You cannot send a stream, you have to "materialize" it before:
As an alternative have a look at this BytesMessageOutputStream: This way you should be able to stream, however the BytesMessage
probably needs to buffer anyway.
Upvotes: 1
Reputation: 2745
An inputstream generally points to some resource. This resource might not be available to the consumer of your queue.
You can convert your inputstream to a byte[]
which represents the loaded resource and send it that way.
Upvotes: 0