canvas-lms/config/notification_failures.yml.e...

8 lines
314 B
Plaintext
Raw Normal View History

Add notification failure processor Using the new notification_service allows us to provide more specific failure feedback to canvas. When we enqueue a message to the notification service, we pass along the canvas global message id. If the message fails to send, we enqueue a failure message to a "notification_failure" sqs queue, and reference the global message id. This allows us to write failure information off to the canvas message object and put it into an error state. Test Plan: * Start local fake_sqs environment If using docker `$ docker pull feathj/fake-sqs` `$ docker run -it -p 9494:9494 -e VIRTUAL_HOST=sqs.docker feathj/fake-sqs` If running native `$ gem install fake_sqs` `$ fake_sqs` * Create `<canvas>/config/notification_failures.yml` file and place the following in it: If using docker ``` development: use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` If running native ``` development: use_ssl: false sqs_endpoint: localhost sqs_port: 4568 access_key_id: access key id secret_access_key: secret access key ``` * Create a canvas message to put in error state * Login to canvas * Create new conversation message * Open rails console and confirm that message.state is not "transmission_error", also take note of message id * Start canvas jobs, from canvas-lms directory: `$ bundle exec script/delayed_job run` * Manually enqueue failure message to fake_sqs ``` require 'yaml' require 'aws-sdk' require 'aws-sdk-core' require 'aws-sdk-resources' require 'aws-sdk-v1' client = AWS::SQS::Client.new( use_ssl: false, sqs_endpoint: '<YOUR_SQS_HOST>', sqs_port: <YOUR_SQS_PORT>, access_key_id: 'access key id', secret_access_key: 'secret access key' ) client.create_queue(queue_name: 'notification-service-failures') rescue nil queue_url = client .list_queues[:queue_urls] .reject { |queue| /dead/i.match(queue) } .detect { |queue| /notification-service-failures/.match(queue) } puts queue_url puts client.send_message(queue_url: queue_url, message_body: { 'global_id' => <YOUR_MESSAGE_ID>, 'error' => 'the message failed to send amigo' }.to_json) ``` * Verify that message is state is set to "transmission_error" and the transmission_errors field has your error message closes CNVS-26442 Change-Id: Ic379142727d4e186ae3032241caca1b1e4c5e074 Reviewed-on: https://gerrit.instructure.com/70447 Reviewed-by: Christina Wuest <cwuest@instructure.com> Reviewed-by: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins QA-Review: Heath Hales <hhales@instructure.com> Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2016-01-16 08:03:06 +08:00
development:
access_key_id: access_key
secret_access_key: secret_key
Add more robust notification service config Enables canvas to connect to local service queue by allowing other AWS SQS keys to be passed into main config. Test Plan: * Start notification service * Start canvas jobs with notification failures configured for local * copy `config/notification_failures.yml.example` to `config/notification_failures.yml` * modify `notification_failures.yml` to include sqs_endpoint info ``` development: notification_failure_queue_name: notification-service-failures use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` * Start canvas with notification service configured for local * copy `config/notification_service.yml.example` to `config/notification_service.yml` * modify `notification_service.yml` to include sqs_endpoint info ``` development: notification_service_queue_name: notification-service use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` * Enable notification service in rails console * `User.find(1).account.root_account.enable_feature!(:notification_service)` * Add bad email communication channel to a canvas user * Settings -> Add email address 'baduserwithoutdomain@example.com' * Confirm communication channel `CommunicationChannel.last.confirm!` * Modify email address to remove domain * `CommunicationChannel.last.update_attribute(:path, 'baduserwithoutdomain')` * Change default email address to bogus one * Settings -> email addresses -> click star next to "baduser..." * Send message with different account to account with "baduser" email * Confirm that message is set to "transmission_error" state from notifications admin tools * Additionally, "transmission_errors" field can be checked on message record in rails console to see actual error message closes CNVS-27199 Change-Id: I5a6b00f86544dba15598dd1f692524253af42be2 Reviewed-on: https://gerrit.instructure.com/71971 Reviewed-by: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins QA-Review: Gentry Beckmann <gbeckmann@instructure.com> Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2016-02-11 05:59:53 +08:00
# notification_failure_queue_name: notification-service-failures
Add notification failure processor Using the new notification_service allows us to provide more specific failure feedback to canvas. When we enqueue a message to the notification service, we pass along the canvas global message id. If the message fails to send, we enqueue a failure message to a "notification_failure" sqs queue, and reference the global message id. This allows us to write failure information off to the canvas message object and put it into an error state. Test Plan: * Start local fake_sqs environment If using docker `$ docker pull feathj/fake-sqs` `$ docker run -it -p 9494:9494 -e VIRTUAL_HOST=sqs.docker feathj/fake-sqs` If running native `$ gem install fake_sqs` `$ fake_sqs` * Create `<canvas>/config/notification_failures.yml` file and place the following in it: If using docker ``` development: use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` If running native ``` development: use_ssl: false sqs_endpoint: localhost sqs_port: 4568 access_key_id: access key id secret_access_key: secret access key ``` * Create a canvas message to put in error state * Login to canvas * Create new conversation message * Open rails console and confirm that message.state is not "transmission_error", also take note of message id * Start canvas jobs, from canvas-lms directory: `$ bundle exec script/delayed_job run` * Manually enqueue failure message to fake_sqs ``` require 'yaml' require 'aws-sdk' require 'aws-sdk-core' require 'aws-sdk-resources' require 'aws-sdk-v1' client = AWS::SQS::Client.new( use_ssl: false, sqs_endpoint: '<YOUR_SQS_HOST>', sqs_port: <YOUR_SQS_PORT>, access_key_id: 'access key id', secret_access_key: 'secret access key' ) client.create_queue(queue_name: 'notification-service-failures') rescue nil queue_url = client .list_queues[:queue_urls] .reject { |queue| /dead/i.match(queue) } .detect { |queue| /notification-service-failures/.match(queue) } puts queue_url puts client.send_message(queue_url: queue_url, message_body: { 'global_id' => <YOUR_MESSAGE_ID>, 'error' => 'the message failed to send amigo' }.to_json) ``` * Verify that message is state is set to "transmission_error" and the transmission_errors field has your error message closes CNVS-26442 Change-Id: Ic379142727d4e186ae3032241caca1b1e4c5e074 Reviewed-on: https://gerrit.instructure.com/70447 Reviewed-by: Christina Wuest <cwuest@instructure.com> Reviewed-by: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins QA-Review: Heath Hales <hhales@instructure.com> Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2016-01-16 08:03:06 +08:00
# idle_timeout: 10
# You can also specify the following values to be passed into the sqs queue's
Add more robust notification service config Enables canvas to connect to local service queue by allowing other AWS SQS keys to be passed into main config. Test Plan: * Start notification service * Start canvas jobs with notification failures configured for local * copy `config/notification_failures.yml.example` to `config/notification_failures.yml` * modify `notification_failures.yml` to include sqs_endpoint info ``` development: notification_failure_queue_name: notification-service-failures use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` * Start canvas with notification service configured for local * copy `config/notification_service.yml.example` to `config/notification_service.yml` * modify `notification_service.yml` to include sqs_endpoint info ``` development: notification_service_queue_name: notification-service use_ssl: false sqs_endpoint: sqs.docker sqs_port: 9494 access_key_id: access key id secret_access_key: secret access key ``` * Enable notification service in rails console * `User.find(1).account.root_account.enable_feature!(:notification_service)` * Add bad email communication channel to a canvas user * Settings -> Add email address 'baduserwithoutdomain@example.com' * Confirm communication channel `CommunicationChannel.last.confirm!` * Modify email address to remove domain * `CommunicationChannel.last.update_attribute(:path, 'baduserwithoutdomain')` * Change default email address to bogus one * Settings -> email addresses -> click star next to "baduser..." * Send message with different account to account with "baduser" email * Confirm that message is set to "transmission_error" state from notifications admin tools * Additionally, "transmission_errors" field can be checked on message record in rails console to see actual error message closes CNVS-27199 Change-Id: I5a6b00f86544dba15598dd1f692524253af42be2 Reviewed-on: https://gerrit.instructure.com/71971 Reviewed-by: Steven Burnett <sburnett@instructure.com> Tested-by: Jenkins QA-Review: Gentry Beckmann <gbeckmann@instructure.com> Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2016-02-11 05:59:53 +08:00
# poll command: initial_timeout, wait_time_seconds, visibility_timeout