Closed auarbekov closed 1 year ago
Issue #, if available: Added publish to paho client
Description of changes:
Why is this change necessary:
How was this change tested: run command mvn exec:java in paho-agent module
Test results: Control:
INFO ] 2023-05-22 19:37:26.276 [grpc-default-executor-1] GRPCDiscoveryServer - RegisterAgent: agentId best-thing-akezhan [INFO ] 2023-05-22 19:37:26.324 [grpc-default-executor-1] GRPCDiscoveryServer - DiscoveryClient: agentId best-thing-akezhan address 127.0.0.1 port 36869 [INFO ] 2023-05-22 19:37:26.325 [grpc-default-executor-1] EngineControlImpl - Created new agent control for best-thing-akezhan on 127.0.0.1:36869 [INFO ] 2023-05-22 19:37:26.325 [grpc-default-executor-1] ExampleControl - Agent best-thing-akezhan is connected [INFO ] 2023-05-22 19:37:26.326 [pool-2-thread-2] AgentTestScenario - Playing test scenario for agent id best-thing-akezhan [INFO ] 2023-05-22 19:37:31.018 [pool-2-thread-2] AgentControlImpl - Created connection with id 1 CONNACK 'sessionPresent: true ' [INFO ] 2023-05-22 19:37:31.018 [pool-2-thread-2] AgentControlImpl - createMqttConnection: MQTT connectionId 1 created [INFO ] 2023-05-22 19:37:31.018 [pool-2-thread-2] AgentTestScenario - MQTT connection with id 1 is established [INFO ] 2023-05-22 19:37:36.019 [pool-2-thread-2] AgentControlImpl - PublishMqtt: publishing on connectionId 1 topic test/topic [INFO ] 2023-05-22 19:37:47.070 [pool-2-thread-2] AgentTestScenario - Published connectionId 1 reason code 0 reason string '' [INFO ] 2023-05-22 19:37:52.071 [pool-2-thread-2] AgentControlImpl - SubscribeMqtt: subscribe on connection 1 [ERROR] 2023-05-22 19:37:52.084 [pool-2-thread-2] AgentTestScenario - gRPC error code UNIMPLEMENTED: description: Method ClientControl.MqttClientControl/SubscribeMqtt is unimplemented io.grpc.StatusRuntimeException: UNIMPLEMENTED: Method ClientControl.MqttClientControl/SubscribeMqtt is unimplemented at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271) ~[grpc-stub-1.53.0.jar:1.53.0] at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252) ~[grpc-stub-1.53.0.jar:1.53.0] at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165) ~[grpc-stub-1.53.0.jar:1.53.0] at com.aws.greengrass.testing.mqtt.client.MqttClientControlGrpc$MqttClientControlBlockingStub.subscribeMqtt(MqttClientControlGrpc.java:511) ~[classes/:?] at com.aws.greengrass.testing.mqtt.client.control.implementation.AgentControlImpl.subscribeMqtt(AgentControlImpl.java:209) ~[classes/:?] at com.aws.greengrass.testing.mqtt.client.control.implementation.ConnectionControlImpl.subscribeMqtt(ConnectionControlImpl.java:112) ~[classes/:?] at com.aws.greengrass.testing.mqtt.client.control.AgentTestScenario.testSubscribe(AgentTestScenario.java:197) ~[classes/:?] at com.aws.greengrass.testing.mqtt.client.control.AgentTestScenario.run(AgentTestScenario.java:150) [classes/:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:829) [?:?] [INFO ] 2023-05-22 19:37:52.104 [pool-2-thread-2] AgentControlImpl - closeMqttConnection: MQTT connectionId 1 closed [INFO ] 2023-05-22 19:37:52.109 [pool-2-thread-2] AgentControlImpl - shutdown request sent successfully [INFO ] 2023-05-22 19:37:52.117 [grpc-default-executor-1] GRPCDiscoveryServer - UnregisterAgent: agentId best-thing-akezhan reason Agent shutdown by OTF request 'That's it.' [INFO ] 2023-05-22 19:37:52.117 [grpc-default-executor-1] ExampleControl - Agent best-thing-akezhan is disconnected ^C[I
Client:
[INFO ] 2023-05-22 19:37:25.833 [main] GRPCLinkImpl - Making gPRC client connection with 127.0.0.1:47619 as best-thing-akezhan... [INFO ] 2023-05-22 19:37:26.292 [main] GRPCLinkImpl - Client connection with Control is established, local address is 127.0.0.1 [INFO ] 2023-05-22 19:37:26.321 [main] GRPCControlServer - GRPCControlServer created and listed on 127.0.0.1:36869 [INFO ] 2023-05-22 19:37:26.359 [main] GRPCLinkImpl - Handle gRPC requests [INFO ] 2023-05-22 19:37:26.359 [main] GRPCControlServer - Server awaitTermination [INFO ] 2023-05-22 19:37:29.359 [grpc-default-executor-0] GRPCControlServer - createMqttConnection: clientId best-thing-akezhan broker a2rytmonq5cblh-ats.iot.eu-central-1.amazonaws.com:8883 [INFO ] 2023-05-22 19:37:31.009 [grpc-default-executor-0] Mqtt311ConnectionImpl - MQTT 3.1.1 connection 1 is establisted [INFO ] 2023-05-22 19:37:36.031 [grpc-default-executor-0] GRPCControlServer - Publish: connectionId 1 topic test/topic QoS 1 retain false [INFO ] 2023-05-22 19:37:46.525 [grpc-default-executor-0] GRPCControlServer - Publish response: connectionId 1 reason code 0 reason string [INFO ] 2023-05-22 19:37:52.088 [grpc-default-executor-0] GRPCControlServer - closeMqttConnection: connectionId 1 reason 4 [INFO ] 2023-05-22 19:37:52.101 [grpc-default-executor-0] Mqtt311ConnectionImpl - MQTT 3.1.1 connection 1 has been disconnected [INFO ] 2023-05-22 19:37:52.106 [grpc-default-executor-0] GRPCControlServer - shutdownAgent: reason That's it. [INFO ] 2023-05-22 19:37:52.113 [main] GRPCControlServer - Server awaitTermination done [INFO ] 2023-05-22 19:37:52.113 [main] GRPCLinkImpl - Shutdown gPRC link [INFO ] 2023-05-22 19:37:52.121 [main] Main - Execution done successfully Disconnected from the target VM, address: '127.0.0.1:34077', transport: 'socket'
Any additional information or context required to review the change:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Needs to be rebased
the branch is rebased
Issue #, if available: Added publish to paho client
Description of changes:
Why is this change necessary:
How was this change tested: run command mvn exec:java in paho-agent module
Test results: Control:
Client:
Any additional information or context required to review the change:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.