Tried sending MapMessage to Servicemix for routing it from JBoss-queue to
another JBoss-queue with ServiceMix jms consumer/provider pair, getting:
2006-09-07 10:33:30,363 ERROR
[org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor] Error
while handling jms message
java.lang.IllegalArgumentException: JMS message should be a text or bytes
message
at
org.apache.servicemix.jms.AbstractJmsProcessor.toNMS(AbstractJmsProcessor.java:187)
at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.access$300(MultiplexingConsumerProcessor.java:41)
at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor$1.run(MultiplexingConsumerProcessor.java:95)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
This is because Servicemix only handles/supports TextMessage and
BytesMessage types .
See sourcefile
org.apache.servicemix.jms.multiplexing.MultiplexingProviderProcessor.java
method onMessage() :
if (message instanceof TextMessage) {
is = new ByteArrayInputStream(((TextMessage)
message).getText().getBytes());
} else if (message instanceof BytesMessage) {
int length = (int) ((BytesMessage)
message).getBodyLength();
byte[] bytes = new byte[length];
((BytesMessage) message).readBytes(bytes);
is = new ByteArrayInputStream(bytes);
} else {
throw new IllegalArgumentException("JMS
message should be a text or bytes message");
}
Is support for MapMessage and ObjectMessage planned in future release?
tia
johan
johper wrote:
>
> Hi
>
> Sending a JMS-message (TextMessage) from a client into SM JMS-consumer and
> route it to another queue via JMS-provider is ok we do that.
>
> In real life our JMS-message client can send either a MapMessage or an
> ObjectMessage to same JMS-consumer (queue) in SM. Can the NMR
> translate/parse there messages or is there an api I can use to hook into
> the message exchange in SM ?
>
> In worse case I can preprocess these messages by creating an MDB in JBoss
> but would like to use Servicemix if possible?
>
> Any ideas?
>
> /Johan
>
>
--
View this message in context:
http://www.nabble.com/MapMessage-and-or-ObjectMessage-tf2226788.html#a6186746
Sent from the ServiceMix - User forum at Nabble.com.