Skip to content

Crashes on stream declaration on RabbitMQ main (upcoming 4.2 version) #45

@mkuratczyk

Description

@mkuratczyk

Describe the bug

RabbitMQ 4.2 (currently the main branch) changed a stream declaration behaviour. This leads to the stream declaration test panicking, since the leader is not available in the response from the declaration request:

• [PANICKED] [0.036 seconds]
AMQP Queue test  [It] AMQP Declare Stream Queue and Get/Delete should succeed
/Users/mkuratczyk/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp/amqp_queue_test.go:111

  [PANICKED] Test Panicked
  In [It] at: /opt/homebrew/Cellar/go/1.24.3/libexec/src/runtime/iface.go:275 @ 05/12/25 13:33:45.366

  interface conversion: interface {} is nil, not string

  Full Stack Trace
    github.com/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp.newAmqpQueueInfo(...)
    	/Users/mkuratczyk/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp/amqp_queue.go:35
    github.com/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp.(*AmqpQueue).Declare(0x14000103e98, {0x10344a138, 0x103755a40})
    	/Users/mkuratczyk/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp/amqp_queue.go:165 +0x74c
    github.com/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp.(*AmqpManagement).DeclareQueue(0x14000390540, {0x10344a138, 0x103755a40}, 0x140000fc6e0?)
    	/Users/mkuratczyk/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp/amqp_management.go:190 +0x270
    github.com/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp.init.func7.6()
    	/Users/mkuratczyk/rabbitmq/rabbitmq-amqp-go-client/rabbitmq_amqp/amqp_queue_test.go:116 +0x8c

Reproduction steps

gikngo -r against current RabbitMQ main branch (what's going to be 4.2)

Expected behavior

the client should handle both behaviours

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions