-
Notifications
You must be signed in to change notification settings - Fork 92
Send Message Batching #46
Comments
@vcabbage also related to this, when sending an improperly encode batch message, I'm seeing a corresponding disposition with an encoding error, but send does not return an error. Is this expected?
|
I'm confused. The code you linked to says: // proton-j doesn't support multiple dataSections to be part of AmqpMessage
// here's the alternate approach provided by them: https://github.com/apache/qpid-proton/pull/54 The code in your PR shows using multiple data sections. Can you explain how they're related? |
I'm not sure about the disposition error off the top of my head. I'll look at it in more detail after work. |
The difference in multiple data sections in the PR is that the data sections are double encoded, first as a message with properties, and then as a data section / binary. This paired with When running the code as it is originally: for _, data := range m.Data {
writeDescriptor(wr, typeCodeApplicationData)
err := writeBinary(wr, data)
if err != nil {
return err
}
} You would receive the following decode-error from Event Hub.
When doing the double encoding (in the PR), the messages are parsed properly. As I said in the PR, I'm not sure this is how batching works across broker implementations and thus, not sure if it belongs in this library or somewhere more vendor specific. |
Ok, if I'm understanding correctly, it seems that to support this use case we could export a function or method to encode an |
Yes, I think that is probably the best way to support this. |
Regarding the rejected disposition, that is a bug. I've opened #48 to track it. |
Related to: #35
After digging into send batching in Azure Event Hubs, I found the current implementation does not actually accomplish send batching as Event Hubs expects. Unfortunately, the structure that Event Hubs expects also can't be built easily via the publicly exposed structures.
Here's the Java code to implement this feature via Proton messages.
Basically, the first message is marshaled with an empty data body, then each data body is used to create an inner message, which is marshaled and added to a wrapper message. Finally, the wrapped messages are marshaled at the end of the first message.
I'll add a PR to better explain the process.
The text was updated successfully, but these errors were encountered: