kapua
kapua copied to clipboard
Problems with translators in kapua-translator-kura-mqtt module
Describe the bug This issue contains different problems, which are explained bellow.
- Translators in kapua-translator-kura-mqtt module (
translate()
method) are not working correctly. InTranslatorDataMqttKura
andTranslatorDataKuraMqtt
all topics/channels pass without exception, which is wrong. - In TranslatorDataMqttKura, when user tries to translate
MqttMessage
intoKuraDataMessage
, if correct topic is forwardedKuraDataChannel
is not valid, and semantic part ofKuraDataChannel
always is null. - In
TranslatorDataKuraJms
andTranslatorDataKuraJms
all topics/channels are correct, and exception is never thrown. - Specific translators have the same problem as
TranslatorDataKuraJms
--> Wrong topic is accepted as correct, and exception is not thrown. InTranslatorLifeNotifyJmsKura
only jms topic with six parts are correct. In other case,ArrayIndexOutOfBoundsException
exception is thrown. But topic, can contains every symbols in that six parts. For examplefff.eee.eee.eee.eee.eee
topic is correct, which is wrong.
To Reproduce Steps to reproduce the first behavior:
- Create
MqttMessage
orKuraDataMessage
with invalid topic / channel - Try to translate it
- Exception is not thrown
Steps to reproduce the second behavior:
- Create
MqttMessage
with valid topic (accont/clientId/semanticPart) - Try to translate it into
KuraDataMessage
-
KuraDataChannel
has NULL semantic part
Steps to reproduce the third behavior:
- Create
JmsMessage
orKuraDataMessage
with invalid topic / channel - Try to translate it
- Exception is not thrown
Steps to reproduce the fourth behavior:
- Create specific JMS message (
Translator{appName}JmsKura
) with invalid topic - Try to translate it
- Exception is not thrown
Expected behavior
--> In first behavior, if user put invalid topic in MqttMessage
, or invalid channel in KuraDataMessage
, after translation an exception should be thrown.
--> In second behavior, if user put valid topic into MqttMessage
, KuraDataChannel
should have semantic part.
--> In third behavior, if user put invalid topic in JmsMessage
, or invalid channel in KuraDataMessage
, after translation an exception should be thrown.
--> In fourth behavior, if user creates specific JmsMessage
with invalid topic, after translation an exception should be thrown. Also, if user try to create TranslatorLifeNotifyJmsKura
with six parts which are not correct, KapuaException
should be thrown.
Screenshots /
Version of Kapua [e.g. 1.0.0]
Type of deployment [ ] Local Vagrant deployment [ ] Docker [ ] Openshift (in its variants) [ ] Others
Main component affected [ ] Console (in case of console please report info on which browser you encountered the problem) [ ] REST API [ ] Message Broker [ ] - Others
Additional context Add any other context about the problem here.