Skip to content

AMQContentHeader toString uses dashes instead of underscores for property names #148

Open
@ddewaele

Description

@ddewaele

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions