camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddang <>
Subject Camel-Stomp Component Serialization Issue
Date Thu, 30 Jan 2014 22:28:28 GMT
I have an issue with the camel-stomp component. When I transport String
messages over the stomp component and receive the String back from the Stomp
broker it is prepended with "ascii: ". Shouldn't Strings be received in the
same state they were sent?

Here is a hand-written (and likely full of errors) approximation of the code
we use:

package com.SomeCompany.SomeProject;
public class SomeClass {
    private ProducerTemplate messageChannel;

    public void someMethod() {
        String msg = "hi there"

    public void handleMessage(String message) {
        // output: "ascii: hi there"

            <from uri="seda:msgChannel?concurrentConsumers=1" />
            <to uri="stomp:queue:stompMessage" />
            <from uri="stomp:queue:stompMessage" />
            <bean ref="someBean" method="handleMessage"/>

        <bean id="stomp"
            <property name="brokerURL" value="tcp://localhost:61613"/>
            <property name="passcode" value="guest" />
            <property name="login" value="guest" />

        <bean id="someBean" class="com.SomeCompany.SomeProject.SomeClass" />

Digging a little deeper, when I modify the above to send Serializable
objects, I receive back org.fusesource.hawtbuf.Buffer objects instead of an
instance of the original class. For example if I sent an Animal object, I
get back a Buffer object whose toString method returns the toString of that
animal with "ascii: " prepended:

public class Animal implements Serializable {
    public String toString() {
        return "moo";

public class someOtherClass {
    public void handleMessage(Buffer buffer) {
        // output: "ascii: moo"

If I send an object through the stomp-component, shouldn't I receive the
same object back on the other end?

Is there something I'm missing? I'm new to Camel so I'm likely doing
something wrong.

I'm using:
camel-stomp 2.12.2
Spring Framework 4.0 Release
RabbitMQ 3.2.2 with Stomp plugin as the Stomp Broker
JDK 1.7

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message