esa / CCSDS_MO_MAL_IMPL

CCSDS MO MAL implementation in Java
Other
1 stars 8 forks source link

LookupAddress failed to find local endpoint #8

Open SteffenBamfaste opened 7 years ago

SteffenBamfaste commented 7 years ago

If an unregistered provider sends publish messages to a broker, the broker will throw a MALInteractionException during the handling of the message and will send an error message back to the provider to inform about the error.

Upon reception of the error message the provider is logging "WARNING: lookupAddress failed to find local endpoint for EndPointPair{first=xyz-Parameter, second=null}". This behaviour doesn't influence the successful delivery of the error message but is not as desired.

SamCooper commented 7 years ago

It caused by the fact that a publish error is returned to the publisher as a PUBLISH messages with the isError flag set to true. This is all fine except the MessageReceive class does a lookupAddress call here:

https://github.com/esa/CCSDS_MO_MAL_IMPL/blob/master/src/main/java/esa/mo/mal/impl/MessageReceive.java#L201

as it should in a broker (as a broker is a MAL service provider for publish operations) except in the publisher we are not a MAL service provider so the lookup fails. If you look into the method it calls next (internalHandlePublish) there is a check to see if its an error message, and if it is it doesn't use the address argument.

The fix is to split the internalHandlePublish method into two, one for error messages and one for not error messages. The same applies actually to the NOTIFY message.

CesarCoelho commented 3 years ago

Moved here: https://github.com/esa/mo-services-java/issues/9

Please close