amqp / rhea

A reactive messaging library based on the AMQP protocol
Apache License 2.0
273 stars 80 forks source link

Use toRheaTyped to wrap custom types #377

Closed kohtala closed 2 years ago

kohtala commented 2 years ago

Having to convert your data for sending as a message makes use more complicated.

This allows defining toRheaTyped to your types so you can send them without wrapping them beforehand. The Typed object is turned into a custom type of itself.

There would be use for a function like the replacer function in JSON.stringify to handle types received from other libraries. But I did not see any immediate easy and efficient solution to having it defined. Maybe some kind of option you could pass on send or add on message, link, session or container.

grs commented 2 years ago

Thanks @kohtala !