Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

support for other message formats other than the default uint32(0) #35

Closed
devigned opened this issue Feb 14, 2018 · 4 comments
Closed

Comments

@devigned
Copy link
Contributor

amqp/client.go

Line 274 in ccafaa7

messageFormat = uint32(0) // Only message-format "0" is defined in spec.

One such example for non-default message formats is sending batch messages in Azure Service Bus. The following message format is used in the Java lib.

public static final int AMQP_BATCH_MESSAGE_FORMAT = 0x80013700; // 2147563264L;

via here

Perhaps, send should support TransferOption variadic arguments. Thoughts?

@vcabbage
Copy link
Owner

Would it make sense to add a Format field to the Message struct?

What is the format used for? The spec doesn't go into much detail about it.

@devigned
Copy link
Contributor Author

I think it would make sense on the message.

I don’t know what else message format is used for. As you said, there not much to grok from the spec. I’ll ask amongst messaging folks and ping back if I get a better answer.

vcabbage added a commit that referenced this issue Feb 15, 2018
When sending this field allows specifying the format code. When
receiving it provides the format code specified by the server.

Resolves #35
@vcabbage
Copy link
Owner

Looking at the usage in the Java lib, it seems the AMQP_BATCH_MESSAGE_FORMAT code might be a workaround for proton-j not supporting multiple data sections. This lib doesn't currently support that either, but only because I didn't need that when I first implemented it and I haven't decided on a good way to expose that on the message type. Would multiple data section support be useful to you?

https://github.com/Azure/azure-event-hubs-java/blob/c1365b956f2b0bf9f65db92385a6d433f5dba28c/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageSender.java#L273-L305

@devigned
Copy link
Contributor Author

That is precisely what I'm implementing right now, so yes, it would be useful. If you feel like multiple data section support is something you'd like to expose from this library, I'll gladly use it.

vcabbage added a commit that referenced this issue Feb 15, 2018
When sending this field allows specifying the format code. When
receiving it provides the format code specified by the server.

Resolves #35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants