rabbitmq / rabbitmq/rabbitmq-java-client

AMQContentHeader toString uses dashes instead of underscores for property names

Open
#148 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

effort-tiny usability
Dominant language
Java
Stars
1.3k
Forks
587
Avg merge
7h 29m
Merged PRs (30d)
41

Description

The com.rabbitmq.client.impl.AMQContentHeader has the following toString implementation

    @Override public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("#contentHeader<").append(getClassName()).append(">");
        this.appendPropertyDebugStringTo(sb);
        return sb.toString();
    }

It generates strings like this

#contentHeader<basic>(content-type=application/json, content-encoding=UTF-8, headers={topic=DOWNLOAD_AND_INSTALL, content-type=application/json, type=EVENT, tenant=DEFAULT, __TypeId__=org.eclipse.hawkbit.dmf.json.model.DownloadAndUpdateRequest, thingId=new_device}, delivery-mode=2, priority=0, correlation-id=null, reply-to=null, expiration=null, message-id=null, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null)

This could make believe that content-type, content-encoding,..... are "valid" AMQP properties, while in fact RabbitMQ states :

Invalid properties will be ignored. Valid properties are:

content_type
content_encoding
priority
correlation_id
reply_to
expiration
message_id
timestamp
type
user_id
app_id
cluster_id

Notice the difference between the dash (-) and the ('_underscore')

To avoid confusion, the java client should print the "official" property names using underscores.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in com.rabbitmq.client.impl.AMQContentHeader and inspect toString together with appendPropertyDebugStringTo. Update the displayed AMQP property names to use underscores rather than dashes, then verify the resulting output matches the official property names listed in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, rabbitmq
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.