Masstransit.host : how to configure Serializer

92 views
Skip to first unread message

Kiran

unread,
Aug 31, 2016, 9:54:10 AM8/31/16
to masstransit-discuss
Need to host two consumers one with JSON and the other with XML as Serializer, any thoughts on how I can configure it using Masstransit.Host.

Thanks

Chris Patterson

unread,
Aug 31, 2016, 10:30:09 AM8/31/16
to masstrans...@googlegroups.com
Not possible currently.

Any endpoint can consume any serialized message, by the way. It can be JSON or XML and it will consume fine. Specifying a serializer only relates to sending and publishing. 

__
Chris Patterson




On Wed, Aug 31, 2016 at 6:54 AM -0700, "Kiran" <kiran....@gmail.com> wrote:

Need to host two consumers one with JSON and the other with XML as Serializer, any thoughts on how I can configure it using Masstransit.Host.

Thanks

--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/a465a90b-49d6-4b2b-a02f-dfcf70bee2a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kiran

unread,
Sep 6, 2016, 12:41:11 PM9/6/16
to masstransit-discuss
I am trying to send a dataset and the issue with Json is that it incorrectly formats the column name from <FIRST_COLUMN> to <firsT_COLUMN> ( this is the core issue I am trying to solve). So I thought of switching to XML. But in request/Response when I switch to xml the consumer throws the following exception. Any thoughts ?

 

MT-Fault-Message:Unexpected JSON token when reading DataTable. Expected StartArray, got StartObject. Path 'newDataSet.table1'.




<?xml version="1.0" encoding="utf-8"?>
<envelope>
  <messageId>d3950000-96e2-9890-e1f5-08d3d671e28c</messageId>
  <requestId>d3950000-96e2-9890-bce4-08d3d671e280</requestId>
  <conversationId>d3950000-96e2-9890-d79c-08d3d671e290</conversationId>
  <sourceAddress>rabbitmq://rabbitmqqa:5672/bus-395-ConsoleApplication_MT_Test-4qkoyyrshkcjyg48bdj7chxnbg?durable=false&amp;autodelete=true&amp;prefetch=16</sourceAddress>
  <destinationAddress>rabbitmq://rabbitmqqa/KtestQueue</destinationAddress>
  <responseAddress>rabbitmq://rabbitmqqa:5672/bus-NYCW7D-E2D395-ConsoleApplication_MT_Test-4qkoyyrshkcjyg48bdj7chxnbg?durable=false&amp;autodelete=true&amp;prefetch=16</responseAddress>
  <messageType>urn:message:ConsoleApplication_MT_Test_Contract:ITestRequest</messageType>
  <message>
    <requestName>TestSample</requestName>
    <newDataSet>
      <table1>
        <firsT_COLUMN>test</firsT_COLUMN>
        <seconD_COLUMN>testing</seconD_COLUMN>
      </table1>
    </newDataSet>
  </message>
  <headers />
  <host>
    <machineName>395</machineName>
    <processName>ConsoleApplication_MT_Test</processName>
    <processId>16044</processId>
    <assembly>ConsoleApplication_MT_Test</assembly>
    <assemblyVersion>1.0.0.0</assemblyVersion>
    <frameworkVersion>4.0.30319.42000</frameworkVersion>
    <massTransitVersion>3.0.15.258</massTransitVersion>
    <operatingSystemVersion>Microsoft Windows NT 6.1.7601 Service Pack 1</operatingSystemVersion>
  </host>
</envelope>




Reply all
Reply to author
Forward
0 new messages