내용으로 건너뛰기

Creating a Remote Job does not trigger a NextNotification

0

Hello, I am developing a Greengrass component responsible for handling remote jobs following this guide. When the components starts it successfully retrieves a pending job using the get mqtt topic, however when I update its status to Succeded I don't receive a notification in the $aws/things/MyThing/jobs/notify-next topic even though I am correctly subscribed.

I tried subscribing using the Messaging test client on the Thing from the LocalDebugConsole component and the problem persists, however when the MQTT test client directly from the AWS dashboard the messages arrive correctly (both on the notify and notify-next topics)

질문됨 일 년 전189회 조회

2개 답변
0
수락된 답변

For future reference, looks like the policy should be attached directly to the thing instead of a thing group in order to receive notify-next updates.

답변함 일 년 전

전문가

검토됨 일 년 전

0

When working with AWS IoT Jobs, there are specific conditions under which notifications are published to the jobs/notify and jobs/notify-next topics.

Based on your description, there are a few potential reasons why you're not receiving a notification on the $aws/things/MyThing/jobs/notify-next topic:

  1. The notify-next topic only receives a message when the status of the first job execution in the list changes. If you're updating a job to "Succeeded" but it wasn't the next job in the queue (or if there are no other jobs in the queue), you won't receive a notification on the notify-next topic.

  2. When a job completes (status changes to "Succeeded"), a notification is published to the jobs/notify topic, but a notification is only published to the jobs/notify-next topic if the next job in the queue has changed as a result.

  3. If the queue is empty after your job completes, a NextNotification should be published to the jobs/notify-next topic with an empty message.

Since you mentioned that you can see the messages when using the MQTT test client from the AWS dashboard but not from the LocalDebugConsole component, this suggests a potential issue with your Greengrass component's subscription or message handling:

  • Verify that your Greengrass component has the correct permissions to subscribe to these topics
  • Check that you're using QoS level 1 for your subscriptions
  • Ensure that your component is correctly processing the messages it receives

Also, note that response messages from the AWS IoT Jobs service don't pass through the message broker and can't be subscribed to by other clients or rules. To receive job activity-related messages, you need to use the notify and notify-next topics and ensure that jobs events are enabled.
Sources
Jobs notifications - AWS IoT Core
Jobs events - AWS IoT Core
AWS IoT Device Not Starting Remote Job | AWS re:Post

답변함 일 년 전

전문가

검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠