Thanks. The issue was because the XML's were of type StringSource. I need one
more help
I have written a file marshaller which implements
org.apache.servicemix.components.util.FileMarshaler, and in the
writeMessage(), I am creating a new InOnlyExchange for each XML messages.
factory = (ClientFactory) new
InitialContext().lookup(ClientFactory.DEFAULT_JNDI_NAME);
client = factory.createClient();
Destination destination =
client.createDestination("service:http://com.mycompany/esb/msgStorageService");
InOnly inOnlyExchange = destination.createInOnlyExchange();
inOnlyExchange.setProperty("org.apache.servicemix.correlationId",
exchange.getProperty("org.apache.servicemix.correlationId"));
NormalizedMessage inMessage = inOnlyExchange.getInMessage();
inMessage.setContent(out.getContent());
exchanges.put(inOnlyExchange.getExchangeId(), exchange);
client.send(inOnlyExchange);
I want to know if this is the right approach for posting multiple messages?
thanks..
subh wrote:
>
> I need to parse a CSV file having multiple rows with delimiter, transform
> it to a XML message per row and invoke a external webservice.
>
> I am successfull in parsing the CSV and generating the necessary XML
> message inside of a FileMarshaler.
>
> But I am facing an issue as its putting only the last XML message to the
> JMS queue? For the first (n-1) messages, I get the following on the
> console
>
> LOG:
> ######
> DEBUG - SedaQueue -
> [EMAIL PROTECTED] dequeued
> exchange: InOut[
> id: ID:10.30.9.159-11ce202fed0-135:0
> status: Active
> role: provider
> service: {http://com.mycompany/esb}msgStorageService
> endpoint: camel10-30-9-159-11ce202fed0-21-30
> in: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in prolog.
> ]
> DEBUG - CamelJbiComponent - Received exchange: status:
> Active, role: provider
> DEBUG - CamelJbiComponent - Retrieved correlation id: null
> [Fatal Error] :1:39: Content is not allowed in prolog.
> DEBUG - CamelJbiEndpoint - Received exchange: InOut[
> id: ID:10.30.9.159-11ce202fed0-135:0
> status: Active
> role: provider
> service: {http://com.mycompany/esb}msgStorageService
> endpoint: camel10-30-9-159-11ce202fed0-21-30
> in: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in prolog.
> ]
> [Fatal Error] :1:39: Content is not allowed in prolog.
> DEBUG - Pipeline - Message exchange has failed so
> breaking out of pipeline: Exchange[JbiMessage:
> org.apache.servicemix.jbi.messaging.NormalizedMessa
> [EMAIL PROTECTED]: {}}] exception:
> org.apache.camel.RuntimeCamelException: org.xml.sax.SAXParseException:
> Content is not allowed in prolog. fault: null
> DEBUG - DeliveryChannelImpl - Send
> ID:10.30.9.159-11ce202fed0-135:0 in DeliveryChannel{servicemix-camel}
> DEBUG - SecuredBroker - send exchange with secure broker
> DEBUG - SedaFlow - Called Flow send
> [Fatal Error] :1:39: Content is not allowed in prolog.
> DEBUG - SedaQueue -
> [EMAIL PROTECTED] dequeued
> exchange: InOut[
> id: ID:10.30.9.159-11ce202fed0-135:0
> status: Active
> role: consumer
> service: {http://com.mycompany/esb}msgStorageService
> endpoint: camel10-30-9-159-11ce202fed0-21-30
> in: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in prolog.
> ]
>
>
> Any help will be appreciated.
>
> thanks...
>
>
--
View this message in context:
http://www.nabble.com/Multiple-messages-handling..-tp19908032p19923747.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.