Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outgoing mqtt connections fail to publish messages when tracing is enabled #1563

Closed
JeffreyThijs opened this issue Jan 11, 2023 · 4 comments
Closed
Labels
Milestone

Comments

@JeffreyThijs
Copy link
Contributor

If we enable open tracing on the ditto services, active outgoing mqtt connections (other types might have this problem as well) fail to publish their messages due to failing to transform ExternalMessage to GenericMqttPublish due to a blank tracestate header in the ExternalMessage headers.

The following error is thrown:

Ran into a failure when publishing signal: Failed to send message: 
Failed to transform ExternalMessage to GenericMqttPublish: The value 
must not be blank. Sending the message to an external system failed, 
please check if your connection is configured properly and the target 
system is available and consuming messages. - Message headers: 
[content-type=application/vnd.eclipse.ditto+json, tracestate=, 
context-tags=upstream.name=ditto-connectivity;, 
traceparent=00-3f0f66b556dc61e2250e5355bb33f83a-142e83f65527125d-01, 
correlation-id=782a32b1-4660-462d-8ac7-51d865bc3d0c] 

Is this expected behavior? If so, why is it required that the headers are blank? It is a bit silly that this requirement completely disrupts the publication of messages.

@thjaeckle
Copy link
Member

thjaeckle commented Jan 11, 2023

This is surely not the expected behavior. Looks like a bug to me.

The error message seems to come from:

private static String assertNeitherNullNorBlank(final String s, final String argumentName) {
return ConditionChecker.checkArgument(ConditionChecker.checkNotNull(s, argumentName),
a -> !a.isBlank(),
() -> MessageFormat.format("The {0} must not be blank.", argumentName));
}

Invoked here trying to map all external headers to MQTT5 user properties:

So this only affects MQTT5 connections.
Non-existant (null) values should probably just be ignored ..

@jufickel-b could you have a look?

*edit: had another look and adjusted the potential source of the error to MQTT5 user property mapping

@thjaeckle thjaeckle added the bug label Jan 11, 2023
@thjaeckle
Copy link
Member

@JeffreyThijs if this is urgent to you, I suggest you propose a PR fixing the issue.
As tracing is currently not in use by the Bosch team, this probably won't get high priority.

@JeffreyThijs
Copy link
Contributor Author

@thjaeckle, ok thanks for the clarification. I'll try to provide a PR to fix this problem. However, we encountered this problem with mqtt3 sessions though.

@thjaeckle
Copy link
Member

Fixed via #1565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants