Is your feature request related to a problem? Please describe.
I made a mistake by subscribing to a topic but specifying a wrong data member as the topic
notice my mistake by using topic_name instead of topic
because of the flexibility of python i didn't see any error when specifying topic_name which is not a member of the SubscribeToTopicRequest class.
The error i did see in the greengrass.log was :
2021-10-29T01:45:08.264Z https://forums.aws.amazon.com/ (Thread-6) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: Sending connect response for au.com.mtdata.smartdvr.gg_shadow_config. {}
2021-10-29T01:45:08.267Z https://forums.aws.amazon.com/ (Thread-6) com.aws.greengrass.ipc.common.ExceptionUtil: Unhandled exception in IPC. {}
java.lang.NullPointerException
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1690)
at com.aws.greengrass.builtin.services.pubsub.PubSubIPCEventStreamAgent.handleSubscribeToTopicRequest(PubSubIPCEventStreamAgent.java:160)
at com.aws.greengrass.builtin.services.pubsub.PubSubIPCEventStreamAgent.access$300(PubSubIPCEventStreamAgent.java:45)
at com.aws.greengrass.builtin.services.pubsub.PubSubIPCEventStreamAgent$SubscribeToTopicOperationHandler.lambda$handleRequest$1(PubSubIPCEventStreamAgent.java:237)
at com.aws.greengrass.ipc.common.ExceptionUtil.translateExceptions(ExceptionUtil.java:33)
at com.aws.greengrass.builtin.services.pubsub.PubSubIPCEventStreamAgent$SubscribeToTopicOperationHandler.handleRequest(PubSubIPCEventStreamAgent.java:230)
at com.aws.greengrass.builtin.services.pubsub.PubSubIPCEventStreamAgent$SubscribeToTopicOperationHandler.handleRequest(PubSubIPCEventStreamAgent.java:209)
at software.amazon.awssdk.eventstreamrpc.OperationContinuationHandler.onContinuationMessage(OperationContinuationHandler.java:271)
at software.amazon.awssdk.crt.eventstream.ServerConnectionContinuationHandler.onContinuationMessageShim(ServerConnectionContinuationHandler.java:53)
2021-10-29T01:45:08.270Z https://forums.aws.amazon.com/ (Thread-6) software.amazon.awssdk.eventstreamrpc.RpcServer: New connection code https://forums.aws.amazon.com/ for https://forums.aws.amazon.com/(2021-10-29T01:45:08.270133Z) - <null>. {}
2021-10-29T01:45:08.272Z https://forums.aws.amazon.com/ (Thread-6) software.amazon.awssdk.eventstreamrpc.ServiceOperationMappingContinuationHandler: aws.greengrass#GreengrassCoreIPC authenticated identity: au.com.mtdata.smartdvr.gg_shadow_config. {}
which is not very helpful to find and resolve the issue
Describe the solution you'd like
When subscribing using SubscribeToTopicRequest and there is no topic specified, perhaps have a clear message saying
"Can't subscribe as no topic has been specified"
Describe alternatives you've considered
The alternative is to follow the API from the start.. which is fully on me
Is your feature request related to a problem? Please describe. I made a mistake by subscribing to a topic but specifying a wrong data member as the topic
notice my mistake by using topic_name instead of topic
because of the flexibility of python i didn't see any error when specifying topic_name which is not a member of the SubscribeToTopicRequest class.
The error i did see in the greengrass.log was :
which is not very helpful to find and resolve the issue
Describe the solution you'd like When subscribing using SubscribeToTopicRequest and there is no topic specified, perhaps have a clear message saying "Can't subscribe as no topic has been specified"
Describe alternatives you've considered The alternative is to follow the API from the start.. which is fully on me
Additional context The original issue that lead to this issue being raised : https://forums.aws.amazon.com/thread.jspa?messageID=999711󴄟