Closed JinsPeter closed 1 year ago
Hi @JinsPeter,
To be honest, it's the first time I hear about CloudEvents, but the idea seems really nice and promising.
Regarding the implementation, I'm not so sure that exposing a method to transform ArtemisNetClient's message to AmqpNetLite's message would be the best way to tackle this issue. The fact that we are using AmqpNetLite internally is just an implementation detail, that may change in the future if any better, faster or more promising implementations of AMQP protocol appear in the dotnet landscape.
In my humble opinion, CloudEvents spec is simple enough so we could provide a full-blown integration[1] as an extension library to ArtemisNetClient.
CloudEvent cloudEvent = new CloudEvent(CloudEventsSpecVersion.V1_0)
{
Id = cloudEventId,
Data = m_serializer.SerializeToJson(message),
DataContentType = "application/json",
Source = s_eventSource,
Type = eventType,
Time = DateTime.UtcNow,
};
Message artemisMessage = cloudEvent.ToActiveMqMessage();
Would sth like that work for you?
I cannot promise a specific date, but I could try to implement it after Christmas.
Best, Havret
[1] Maybe we could use CloudNative.CloudEvents.Amqp under the hood to streamline the implementation.
Please check ArtemisNetClient.Extensions.CloudEvents 2.12.0-preview1.
Feature description
Feature in action
Provide a way to convert Amqp.Message to Artemis.Message. Now it only accepts
BodySection
. All metadata is lost. Also provide a way to recreate the cloudevent from the ArtemisMessage.Describe alternatives you've considered
Additional context
CloudNative.CloudEvents.NetSDK - Please see Amqp.