eclipse-basyx / basyx-databridge

Eclipse Public License 2.0
11 stars 18 forks source link

databridge MQTT configuration #303

Closed brkycm closed 4 months ago

brkycm commented 6 months ago

Hello everyone,

I am trying to set up a Databridge (MQTT-jsonata-aas). I want to overwrite the property temperature in the testing submodel of a simple AAS using MQTT. I am attaching my basyx setup including the AAS so that you can reproduce my case.

I am also sending the configuration of my Databridge. I start the Databridge with "docker run --name=databridge -p 8085:8085 -v C:/tmp:/usr/share/config eclipsebasyx/databridge:1.0.0-SNAPSHOT". Here are the logs when I start the Docker image:

[main] INFO org.reflections.Reflections - Reflections took 126 ms to scan 13 urls, producing 29 keys and 100 values
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataTransformerConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSinkConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSourceConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.reflections.Reflections - Reflections took 18 ms to scan 13 urls, producing 29 keys and 100 values
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Found files: [temperatureTransformer.jsonata, routes.json, mqttconsumer.json, jsonatatransformer.json, aasserver.json]
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.aas.configuration.factory.AASProducerDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data sink added - aasserver.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Config file doesn't match to consumer, transformer, or server!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataTransformerConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSinkConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSourceConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.paho.configuration.factory.MqttDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data source added - mqttconsumer.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.jsonata.configuration.factory.JsonataDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data Transformer added - jsonatatransformer.json
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Apache Camel 3.21.0 (camel-1) is starting
[main] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASProducer - Creating AAS Producer for endpoint aas:http://localhost:8081/submodels/aHR0cHM6Ly9odHctYmVybGluLmRlL2lkcy9zbS90ZXN0aW5n?propertyPath=temperature&api=DotAAS-V3
[main] INFO org.eclipse.jetty.util.log - Logging initialized @1114ms to org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.51.v20230217; built: 2023-02-17T08:19:37.309Z; git: b45c405e4544384de066f814ed42ae3dceacdd49; jvm 11.0.16+8
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@3a320ade{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@607fbe09{HTTP/1.1, (http/1.1)}{0.0.0.0:8085}
[main] INFO org.eclipse.jetty.server.Server - Started @1244ms
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Routes startup (started:2)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext -     Started app.health.context (jetty:http://0.0.0.0:8085/health)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext -     Started route1 (paho://test/temperature)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Apache Camel 3.21.0 (camel-1) started in 798ms (build:70ms init:183ms start:545ms)
[main] INFO org.eclipse.digitaltwin.basyx.databridge.core.component.DataBridgeComponent - Updater started

Does everything fit here? What do the "...the fiel could not be DEFAULT_FILE_PATH found!" mean? And I get the message "Config file doesn't match to consumer, transformer, or server!", which I don't understand, because everything seems to start...

Then I tried to send an MQTT message with the topic "test/temperature" and the content

{
  "sensors": {
    "temperature": 1.5
  }
}

These are the logs I get:

[MQTT Call: camel-paho41126202983179] INFO route1 - Exchange[ExchangePattern: InOnly, BodyType: byte[], Body: {  "sensors": {    "temperature": 1.5  }}]
[MQTT Call: camel-paho41126202983179] INFO route1 - Exchange[ExchangePattern: InOnly, BodyType: String, Body: 1.5]
[MQTT Call: camel-paho41126202983179] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint - SubmodelEndpoint http://localhost:8081/submodels/aHR0cHM6Ly9odHctYmVybGluLmRlL2lkcy9zbS90ZXN0aW5n
[MQTT Call: camel-paho41126202983179] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint - Proxy URL: http://localhost:8081/submodels/aHR0cHM6Ly9odHctYmVybGluLmRlL2lkcy9zbS90ZXN0aW5n/submodel-elements/temperature
[MQTT Call: camel-paho41126202983179] ERROR org.apache.camel.processor.errorhandler.DefaultErrorHandler - Failed delivery for (MessageId: E61FE83C452ED25-0000000000000001 on ExchangeId: E61FE83C452ED25-0000000000000001). Exhausted after delivery attempt: 1 caught: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8081 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

Message History (source location and message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
Source                                   ID                             Processor                                          Elapsed (ms)
                                         route1/route1                  from[paho://test/temperature?brokerUrl=tcp://host.     39789756
        ...
                                         route1/to4                     aas:http://localhost:8081/submodels/aHR0cHM6Ly9odH            0

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8081 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
        at org.eclipse.digitaltwin.basyx.databridge.aas.http.HTTPRequest.patchRequest(HTTPRequest.java:51)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint.setPropertyValueUsingDotAasV3Api(AASEndpoint.java:172)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint.setPropertyValue(AASEndpoint.java:139)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASProducer.process(AASProducer.java:53)
        at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.paho.PahoConsumer$1.messageArrived(PahoConsumer.java:99)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:519)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:417)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:214)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
        ... 25 more
[MQTT Call: camel-paho41126202983179] WARN org.apache.camel.component.paho.PahoConsumer - Error processing exchange. Exchange[E61FE83C452ED25-0000000000000001]. Caused by: [org.apache.http.conn.HttpHostConnectException - Connect to localhost:8081 [localhost/127.0.0.1] failed: Connection refused (Connection refused)]
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8081 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
        at org.eclipse.digitaltwin.basyx.databridge.aas.http.HTTPRequest.patchRequest(HTTPRequest.java:51)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint.setPropertyValueUsingDotAasV3Api(AASEndpoint.java:172)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint.setPropertyValue(AASEndpoint.java:139)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASProducer.process(AASProducer.java:53)
        at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.paho.PahoConsumer$1.messageArrived(PahoConsumer.java:99)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:519)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:417)
        at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:214)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
        ... 25 more

The connection to the server does not seem to work. I think it can only be due to the "aasserver.json" configuration, but I've tried everything and can't find the error...

Many thanks in advance! basyx-setup_2.zip databridge_configuration.zip

mateusmolina-iese commented 6 months ago

Hi,

I quickly went through your files and noticed that you are using 'host.docker.internal' in your 'mqttconsumer.json' and 'localhost' in your 'aasserver.json'. Could you please try to change it to 'host.docker.internal'?

This could be the issue since you are running 'databridge' outside your docker-compose network and Docker under a Windows machine.

Please let me know if you get a different result with this change.

brkycm commented 6 months ago

Hello,

that actually worked, thanks!

brkycm commented 6 months ago

Hello everyone,

I am currently trying to configure the other way for my testAAS (aas-jsonata-mqtt). Unfortunately my configuration is not working again, so I am reopening this issue. I am attaching again the zip file for my Basyx setup and my databridge configuration. Here are my logs:

docker run --name=databridge -p 8085:8085 -v C:/tmp2:/usr/share/config eclipsebasyx/databridge:1.0.0-SNAPSHOT
[main] INFO org.reflections.Reflections - Reflections took 158 ms to scan 13 urls, producing 29 keys and 100 values
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSinkConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSourceConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataTransformerConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.reflections.Reflections - Reflections took 11 ms to scan 13 urls, producing 29 keys and 100 values
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Found files: [timerconsumer.json, jsonataA.json, routes.json, mqttdatasink.json, jsonatatransformer.json, aaspollingconsumer.json]
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSinkConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.paho.configuration.factory.MqttDataSinkDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data sink added - mqttdatasink.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.aas.configuration.factory.AASPollingConsumerDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data source added - aaspollingconsumer.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataSourceConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - In class org.eclipse.digitaltwin.basyx.databridge.core.configuration.factory.DataTransformerConfigurationFactory the field could not be  DEFAULT_FILE_PATH found!
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.timer.configuration.factory.TimerDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data source added - timerconsumer.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Retrieved method create
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.DataBridgeUtils - Instantiated class org.eclipse.digitaltwin.basyx.databridge.jsonata.configuration.factory.JsonataDefaultConfigurationFactory
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Data Transformer added - jsonatatransformer.json
[main] INFO org.eclipse.digitaltwin.basyx.databridge.component.RoutesConfigurationLoader - Config file doesn't match to consumer, transformer, or server!
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Apache Camel 3.21.0 (camel-1) is starting
[main] INFO org.eclipse.jetty.util.log - Logging initialized @2615ms to org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.51.v20230217; built: 2023-02-17T08:19:37.309Z; git: b45c405e4544384de066f814ed42ae3dceacdd49; jvm 11.0.16+8
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@460f76a6{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@a5b0b86{HTTP/1.1, (http/1.1)}{0.0.0.0:8085}
[main] INFO org.eclipse.jetty.server.Server - Started @2880ms
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Routes startup (started:2)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext -     Started app.health.context (jetty:http://0.0.0.0:8085/health)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext -     Started route1 (timer://foo)
[main] INFO org.apache.camel.impl.engine.AbstractCamelContext - Apache Camel 3.21.0 (camel-1) started in 1s411ms (build:114ms init:441ms start:856ms)
[main] INFO org.eclipse.digitaltwin.basyx.databridge.core.component.DataBridgeComponent - Updater started
[Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint - SubmodelEndpoint //http://host.docker.internal:8081/submodels/aHR0cHM6Ly9odHctYmVybGluLmRlL2lkcy9zbS90ZXN0aW5n
[Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Time out after waiting
[Camel (camel-1) thread #1 - timer://foo] WARN org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Caused by: [java.util.concurrent.ExecutionException - org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException]
java.util.concurrent.ExecutionException: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.doReceive(AASPollingConsumer.java:102)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.receive(AASPollingConsumer.java:89)
        at org.apache.camel.processor.PollEnricher.process(PollEnricher.java:266)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
        at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:83)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElemLive(ConnectedElement.java:63)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElem(ConnectedElement.java:78)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedSubmodel.getLocalCopy(ConnectedSubmodel.java:198)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.getSerializedMetamodel(AASPollingConsumer.java:154)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
        at org.eclipse.basyx.vab.coder.json.metaprotocol.Result.createAsFacade(Result.java:100)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.buildResultFromJSON(HTTPConnector.java:377)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:325)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpGet(HTTPConnector.java:216)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.getValue(HTTPConnector.java:82)
        at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.getValue(JSONConnector.java:105)
        at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:78)
        ... 8 more
[Camel (camel-1) thread #1 - timer://foo] INFO route1 - Exchange[ExchangePattern: InOnly, BodyType: String, Body: ]
[Camel (camel-1) thread #1 - timer://foo] ERROR org.apache.camel.processor.errorhandler.DefaultErrorHandler - Failed delivery for (MessageId: DCC19947C05BF99-0000000000000000 on ExchangeId: DCC19947C05BF99-0000000000000000). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException

Message History (source location and message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
Source                                   ID                             Processor                                          Elapsed (ms)
                                         route1/route1                  from[timer://foo?delay=1000&fixedRate=true&period=     -1617536
        ...
                                         route1/to2                     jsonata:file:/tmp/dataBridge/jsonataA.json?inputTy            0

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
java.lang.NullPointerException
        at org.apache.camel.component.jsonata.JsonataEndpoint.onExchange(JsonataEndpoint.java:120)
        at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
        at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
[Camel (camel-1) thread #1 - timer://foo] WARN org.apache.camel.component.timer.TimerConsumer - Error processing exchange. Exchange[DCC19947C05BF99-0000000000000000]. Caused by: [java.lang.NullPointerException - null]
java.lang.NullPointerException
        at org.apache.camel.component.jsonata.JsonataEndpoint.onExchange(JsonataEndpoint.java:120)
        at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
        at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
[Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Time out after waiting
[Camel (camel-1) thread #1 - timer://foo] WARN org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Caused by: [java.util.concurrent.ExecutionException - org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException]
java.util.concurrent.ExecutionException: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.doReceive(AASPollingConsumer.java:102)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.receive(AASPollingConsumer.java:89)
        at org.apache.camel.processor.PollEnricher.process(PollEnricher.java:266)
        at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
        at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
        at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
        at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
        at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:83)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElemLive(ConnectedElement.java:63)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElem(ConnectedElement.java:78)
        at org.eclipse.basyx.submodel.metamodel.connected.ConnectedSubmodel.getLocalCopy(ConnectedSubmodel.java:198)
        at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.getSerializedMetamodel(AASPollingConsumer.java:154)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
        at org.eclipse.basyx.vab.coder.json.metaprotocol.Result.createAsFacade(Result.java:100)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.buildResultFromJSON(HTTPConnector.java:377)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:325)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpGet(HTTPConnector.java:216)
        at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.getValue(HTTPConnector.java:82)
        at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.getValue(JSONConnector.java:105)
        at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:78)
        ... 8 more
[Camel (camel-1) thread #1 - timer://foo] INFO route1 - Exchange[ExchangePattern: InOnly, BodyType: String, Body: ]
[Camel (camel-1) thread #1 - timer://foo] ERROR org.apache.camel.processor.errorhandler.DefaultErrorHandler - Failed delivery for (MessageId: DCC19947C05BF99-0000000000000001 on ExchangeId: DCC19947C05BF99-0000000000000001). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException

I would be very grateful if someone could have a look at my config files. Actually I have configured everything according to the documentation, maybe it's another little thing I'm overlooking.

Thanks in advance!

basyx-setup_2.zip databridge_configuration_aas-jsonata-mqtt.zip

mateusmolina-iese commented 6 months ago

Hi,

we will take another look at your config files and get back to you.

brkycm commented 6 months ago

Hi, thank you @mateusmolina-iese! I am looking forward to your answer.

mateusmolina-iese commented 6 months ago

Hi @brkycm,

Your config files look all correct. I suspect a bug when sending whole submodels via the V3 API. We'll provide a bug fix in the coming weeks and let you know when it's merged.

Thanks for raising the issue!

brkycm commented 6 months ago

Hi @mateusmolina-iese,

Thanks for the answer! I get the same errors when I try to access individual submodel elements or their value. In fact, I tried that first as well.

Actually, this is also the use case I need. I want to send an MQTT message when the value of a property changes. I am also sending you my configuration for this. Not much changes, just the jsonataA and the "idShortPath" in aaspollingconsumer.json.

I need this use case for an implementation for a scientific paper at the university, if you can take a look at it to see if it works without a bug fix, I would be very grateful! Unfortunately I have some time pressure, otherwise I have to find another way.

Best regards databridge_configuration_aas-jsonata-mqtt_temperaturevalue.zip