.net - Is it possible to have one endpoint in an NServiceBus SOA use a different serializer from the rest? -
somewhat related to: is possible nservicebus endpoint handle , publish using different serializers?
we have wide deployment of nservicebus in our infrastructure , configured using xmlserializer
. however, one-off situation has come in xmlserializer
not going meet our requirements, i'm considering jsonserializer
or binaryserializer
.
changing every single endpoint in entire infrastructure use different serializer highly disruptive , time-wasting in terms of deployments, i'm having trouble figuring out how introduce 1 new endpoint uses different serializer... or rather, it's easy configure endpoint itself use alternate serializer, i'm not sure how can other endpoint talk it.
am stuck 1 serializer type used throughout entire architecture if i'm using nservicebus 3.x? seem remember reading once, think on nservicebus message boards, serialization defined @ endpoint level, there weren't many details given , person wrote answer may have been overlooking obvious interop issue above.
i want architecture this:
+---------+ +------------+ (pub/sub) +------------+ | web app |----->| endpoint |<--------->| endpoint b |<-------> ... +---------+ +------------+ +------------+ | (xml) (xml) | | +------------+ +---------->| endpoint c | +------------+ (json)
the problem is, of course, although can configure endpoint c use jsonserializer
exclusively (and ok this), "web app" still needs have own (send-only) bus in order talk either endpoint or endpoint c. , bus has configured using one serializer. since sends messages number of xmlserializer
-based endpoints, can't switch jsonserializer
. , there's no way i've been able find in configuration or docs direct nservicebus serialize messages differently, either @ message level or @ endpoint level. i'm not sure if changes in nsb 4/5 technically going support because they're around how messages received, not sent.
is there configuration method or setting somewhere i'm missing allow me this? , if not, other sensible options there? perhaps hosting 2 endpoints in web app? or maybe custom serializer delegates other serializers?
you may able use transport level message mutator in nsb pipeline. may case mutation happens late in processing, worth look. otherwise you'll need implement custom serializer mentioned handle different formats.
another thought turn on gateway in endpoints. down http on endpoints , i'm hoping solve it. again, have not confirmed this, putting ideas out there.
Comments
Post a Comment