Skip to content

Entire header frame isn't always read #309

@jamesedwards73

Description

@jamesedwards73

Describe the bug
Sometimes the entire header frame isn't read. In particular, the size variable is ignored in the func (r *reader) parseHeaderFrame method (https://github.com/rabbitmq/amqp091-go/blob/main/read.go#L324). This results in a frame error and the channel being closed.

To Reproduce
This issue was found when trying to consume messages sent by a tool using the java client. Unfortunately, I don't have the tool's code available to share and failed to reproduce the issue with a basic java producer. However, the received header frame that caused the issue was:

\x02\x00\x01\x00\x00\x00\x12\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x54\x00\x00\x00\x00\x00\x00\xce

Expected behavior
Ensure the number of bytes read in parseHeaderFrame is equal to the size variable provided.

Desktop:

  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions