Hi there,
I'm trying to implement AMQP 1.0 in Rust from scratch because I'd like my
Rust service to be able to talk to an Artemis broker. I've been making good
progress, but am hitting some trouble now that I'm trying to send the
attach performative after bringing up the session.
This is what I'm sending:
AmqpFrame {
channel: 0,
extended_header: None,
performative: Attach(
Attach {
name: "vx-web-0",
handle: 0,
role: Sender,
snd_settle_mode: None,
rcv_settle_mode: None,
source: None,
target: Some(
"RPC",
),
unsettled: None,
incomplete_unsettled: None,
initial_delivery_count: None,
max_message_size: None,
offered_capabilities: None,
desired_capabilities: None,
properties: None,
},
),
body: [],
}
which is then encoded (not quite optimal, but seems to be correct per the
spec) as
[0, 0, 0, 70, 2, 0, 0, 0, 0, 163, 16, 97, 109, 113, 112, 58, 97, 116, 116,
97, 99, 104, 58, 108, 105, 115, 116, 208, 0, 0, 0, 38, 0, 0, 0, 14, 161, 8,
118, 120, 45, 119, 101, 98, 45, 48, 67, 163, 6, 83, 101, 110, 100, 101,
114, 64, 64, 64, 161, 3, 82, 80, 67, 64, 64, 64, 64, 64, 64, 64]
In response I receive
AmqpFrame {
channel: 0,
extended_header: None,
performative: Close(
Close {
error: None,
},
),
body: [],
}
When I leave out the target from the attach message, I get a
NullPointerException error instead, apparently from
AMQPSessionContext.addReceiver() -- but when I add the target, any
breakpoints I set in that method aren't even hit. This has me quite
confused (it would have been nice if there was an actual error message
here). I fully expect the problem to be in my code, but would appreciate
any hints towards debugging the problem. I've been trying to get Wireshark
to decode the protocol, but having no luck so far. A pcap with a minimal
successful session might be quite helpful as well, if I'd be able to get
Wireshark to decode it correctly.
Any help would be much appreciated!
Kind regards,
Dirkjan