pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
747 stars 144 forks source link

Remove MessageContext when not in use #93

Closed pardahlman closed 8 years ago

mrfamazing commented 8 years ago

Is the goal here to make RawRabbit more open to messages from any publisher/subscriber, not just .net/RR? I am trying to use RR with a system has other clients that might pub/sub. Message context is one of the things that I am running into trying to send a message from another system. It's a little more complex then just adding a new serializer to consume messages from elsewhere, if impossible at this time. If this isn't the goal of RawRabbit, then you can disregard this, otherwise that would be a great path to go down.

pardahlman commented 8 years ago

@mrfamazing sorry for not decorating this ticket with description. This ticket is in fact more of a note-to-self; I want to make sure to dispose internal resources (MessageContext caches for message chaining).

However, making RawRabbit compatible with clients from other libraries and languages should not be a problem. After all, messages are serialized to json by default and headers are provided as expected :+1: . The framework itself is very modular, and it is pretty straight forward to register your own implementation of say IMessageContextProvider or IBasicPropertiesProvider etc. From the top of my head there are two things that might need to be tweaked:

I'm currently working with support for .NET Core #99 #102, but as soon as I'm done I'll look closer at this. Let me know if you're making any progress!

pardahlman commented 8 years ago

Hi again @mrfamazing!

Just letting you know that I've added a specific ticket #103 for supporting handling of messages without context, headers or... anything, really except a valid json body that is deserializable to the class used in the subscriber. Check the PublishAndSubscribeTests.cs. This will be able in RawRabbit version 1.10.0, which will be released soon. If you can't wait, you should be able to implement the changes from commit adbfcfe yourself.

mrfamazing commented 8 years ago

Thanks for the info @pardahlman ! In my current scenario, ended up only needing to publish from .NET to XYZ, so there isn't an issue. But yes #103 is exactly what I had in mind, awesome work on this library!

pardahlman commented 8 years ago

No problemo, and thanks for the feedback :+1:

pardahlman commented 8 years ago

This ticket will be fixed by #125