aws-greengrass / aws-greengrass-client-device-auth

Apache License 2.0
2 stars 3 forks source link

feat(uat): added userProperties sdk-client #309

Closed auarbekov closed 1 year ago

auarbekov commented 1 year ago

Issue #, if available: added userProperties for sdk-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's log:

INFO ] 2023-06-12 16:08:55.626 [com.aws.greengrass.testing.mqtt.client.control.ExampleControl.main()] EngineControlImpl - MQTT client control gRPC server started, listening on 47619
[INFO ] 2023-06-12 16:09:39.543 [grpc-default-executor-0] GRPCDiscoveryServer - RegisterAgent: agentId best-thing-akezhan
[INFO ] 2023-06-12 16:09:39.632 [grpc-default-executor-0] GRPCDiscoveryServer - DiscoveryClient: agentId best-thing-akezhan address 127.0.0.1 port 33337
[INFO ] 2023-06-12 16:09:39.635 [grpc-default-executor-0] EngineControlImpl - Created new agent control for best-thing-akezhan on 127.0.0.1:33337
[INFO ] 2023-06-12 16:09:39.664 [grpc-default-executor-0] ExampleControl - Agent best-thing-akezhan is connected
[INFO ] 2023-06-12 16:09:39.669 [pool-2-thread-1] AgentTestScenario - Playing test scenario for agent id best-thing-akezhan
[INFO ] 2023-06-12 16:09:44.033 [pool-2-thread-1] AgentControlImpl - Created connection with id 1 CONNACK 'sessionPresent: false
reasonCode: 0
receiveMaximum: 100
maximumQoS: 1
retainAvailable: true
maximumPacketSize: 149504
wildcardSubscriptionsAvailable: true
subscriptionIdentifiersAvailable: false
sharedSubscriptionsAvailable: true
serverKeepAlive: 60
'
[INFO ] 2023-06-12 16:09:44.033 [pool-2-thread-1] AgentControlImpl - createMqttConnection: MQTT connectionId 1 created
[INFO ] 2023-06-12 16:09:44.033 [pool-2-thread-1] AgentTestScenario - MQTT connection with id 1 is established
[INFO ] 2023-06-12 16:09:49.041 [pool-2-thread-1] AgentControlImpl - SubscribeMqtt: subscribe on connection 1
[INFO ] 2023-06-12 16:09:49.255 [pool-2-thread-1] AgentTestScenario - Subscribe response: connectionId 1 reason codes [0] reason string ''
[INFO ] 2023-06-12 16:09:54.261 [pool-2-thread-1] AgentControlImpl - PublishMqtt: publishing on connectionId 1 topic test/topic
[INFO ] 2023-06-12 16:09:54.479 [pool-2-thread-1] AgentTestScenario - Published connectionId 1 reason code 0 reason string ''
[INFO ] 2023-06-12 16:09:54.494 [grpc-default-executor-0] GRPCDiscoveryServer - OnReceiveMessage: agentId best-thing-akezhan connectionId 1 topic test/topic QoS 0
[INFO ] 2023-06-12 16:09:54.496 [grpc-default-executor-0] AgentTestScenario - Message received on agentId best-thing-akezhan connectionId 1 topic test/topic QoS 0 content <ByteString@1f3e5fa3 size=12 contents="Hello World!">
[INFO ] 2023-06-12 16:09:59.484 [pool-2-thread-1] AgentControlImpl - UnsubscribeMqtt: unsubscribe on connectionId 1
[INFO ] 2023-06-12 16:09:59.697 [pool-2-thread-1] AgentTestScenario - Unsubscribe response: connectionId 1 reason codes [0] reason string ''
[INFO ] 2023-06-12 16:10:14.732 [grpc-default-executor-0] GRPCDiscoveryServer - OnMqttDisconnect: agentId best-thing-akezhan connectionId 1 disconnect '' error 'Mqtt5 client connection interrupted by user request.'
[INFO ] 2023-06-12 16:10:14.732 [grpc-default-executor-0] AgentTestScenario - MQTT disconnected on agentId best-thing-akezhan connectionId 1 disconnect '' error 'Mqtt5 client connection interrupted by user request.'
[INFO ] 2023-06-12 16:10:14.741 [pool-2-thread-1] AgentControlImpl - closeMqttConnection: MQTT connectionId 1 closed
[INFO ] 2023-06-12 16:10:14.750 [pool-2-thread-1] AgentControlImpl - shutdown request sent successfully
[INFO ] 2023-06-12 16:10:14.761 [grpc-default-executor-0] GRPCDiscoveryServer - UnregisterAgent: agentId best-thing-akezhan reason Agent shutdown by OTF request 'That's it.'
[INFO ] 2023-06-12 16:10:14.763 [grpc-default-executor-0] ExampleControl - Agent best-thing-akezhan is disconnected

Client's log:

[INFO ] 2023-06-12 16:09:39.129 [main] GRPCLinkImpl - Making gPRC client connection with 127.0.0.1:47619 as best-thing-akezhan...
[INFO ] 2023-06-12 16:09:39.581 [main] GRPCLinkImpl - Client connection with Control is established, local address is 127.0.0.1
[INFO ] 2023-06-12 16:09:39.627 [main] GRPCControlServer - GRPCControlServer created and listed on 127.0.0.1:33337
[INFO ] 2023-06-12 16:09:39.673 [main] GRPCLinkImpl - Handle gRPC requests
[INFO ] 2023-06-12 16:09:39.673 [main] GRPCControlServer - Server awaitTermination
[INFO ] 2023-06-12 16:09:42.745 [grpc-default-executor-0] GRPCControlServer - createMqttConnection: clientId best-thing-akezhan broker a2rytmonq5cblh-ats.iot.eu-central-1.amazonaws.com:8883
[INFO ] 2023-06-12 16:09:42.751 [grpc-default-executor-0] MqttConnectionImpl - Creating Mqtt5Client with TLS
[INFO ] 2023-06-12 16:09:42.895 [Thread-2] MqttConnectionImpl - MQTT connectionId 1 connecting...
[INFO ] 2023-06-12 16:09:43.976 [Thread-2] MqttConnectionImpl - MQTT connectionId 1 connected, client id best-thing-akezhan
[INFO ] 2023-06-12 16:09:49.057 [grpc-default-executor-0] GRPCControlServer - Subscription: filter test/topic QoS 0 noLocal false retainAsPublished false retainHandling 2
[INFO ] 2023-06-12 16:09:49.057 [grpc-default-executor-0] GRPCControlServer - Subscribe: connectionId 1 subscriptionId null for 1 filters
[INFO ] 2023-06-12 16:09:49.246 [grpc-default-executor-0] GRPCControlServer - Subscribe response: connectionId 1 reason codes [0] reason string null
[INFO ] 2023-06-12 16:09:54.273 [grpc-default-executor-0] GRPCControlServer - Publish: connectionId 1 topic test/topic QoS 1 retain false
[INFO ] 2023-06-12 16:09:54.472 [grpc-default-executor-0] GRPCControlServer - Publish response: connectionId 1 reason code 0 reason string null
[INFO ] 2023-06-12 16:09:54.472 [Thread-2] MqttConnectionImpl - Received MQTT message: connectionId 1 topic test/topic QoS 0 retain false
[INFO ] 2023-06-12 16:09:59.490 [grpc-default-executor-0] GRPCControlServer - Unsubscribe: connectionId 1 for [test/topic] filters
[INFO ] 2023-06-12 16:09:59.691 [grpc-default-executor-0] GRPCControlServer - Unsubscribe response: connectionId 1 reason codes [0] reason string null
[INFO ] 2023-06-12 16:10:14.710 [grpc-default-executor-0] GRPCControlServer - closeMqttConnection: connectionId 1 reason 4
[INFO ] 2023-06-12 16:10:14.714 [Thread-2] MqttConnectionImpl - MQTT connectionId 1 disconnected error 'Mqtt5 client connection interrupted by user request.' disconnectPacket 'null'
[INFO ] 2023-06-12 16:10:14.714 [Thread-2] MqttConnectionImpl - MQTT connectionId 1 stopped
[INFO ] 2023-06-12 16:10:14.746 [grpc-default-executor-0] GRPCControlServer - shutdownAgent: reason That's it.
[INFO ] 2023-06-12 16:10:14.755 [main] GRPCControlServer - Server awaitTermination done
[INFO ] 2023-06-12 16:10:14.755 [main] GRPCLinkImpl - Shutdown gPRC link
[INFO ] 2023-06-12 16:10:14.767 [main] Main - Execution done successfully

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.