Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "UnsupportedOperation" error on sending data to AWS AppSync #1567

Closed
neha-2022 opened this issue Aug 15, 2022 · 2 comments
Closed

Getting "UnsupportedOperation" error on sending data to AWS AppSync #1567

neha-2022 opened this issue Aug 15, 2022 · 2 comments

Comments

@neha-2022
Copy link

neha-2022 commented Aug 15, 2022

Configured web socket connection using "connect" and able to create successful web socket connection.
When tried to send subscription registration messages to AWS AppSync using Amazon Cognito user pools authentication, getting below error -

ws WS receive: {"type":"error","payload":{"errors":[{"errorType":"UnsupportedOperation","message":"unknown not supported through the realtime channel"}]}}

Found the solution (apollographql/apollo-feature-requests#224) on the internet but no sure how to use it with artillery.

Version info:

<Artillery Core: 2.0.0-12>

Running this command:

<artillery run .\test-script.yml>

I expected to see this happen:

Subscription should be registered.

Getting this error while sending subscription registration message to AWS AppSync -

ws WS receive: {"type":"error","payload":{"errors":[{"errorType":"UnsupportedOperation","message":"unknown not supported through the realtime channel"}]}}

Files being used:

<test-script.yml>
config:
  target: "wss://endpoint/graphql/realtime"
  ensure: 
    maxErrorRate: 1
  phases:
    - duration: 1
      arrivalRate: 1
      name: "sample load run"
  ws:
    headers: 
       'sec-websocket-protocol': "graphql-ws"
  processor: "./processor.js" 
before:
  flow:
    - function: "getToken"
    - think: 3
scenarios:
  - name: " Load testing subscription "
    engine: "ws"
    flow:    
      - connect: "{{ target }}?header={{ encoded_api_header }}&payload=e30="
      - send:
              {
                "id":"1",
                "payload": {
                      "query": "subscription onCreateMessage {
                          onCreateMessage {
                            __typename
                            }
                          }
                        }",
                      "variables": {},
                      "extensions" : {
                          "authorization" : {
                              "Authorization" : "JWT TOKEN",
                              "host": "API_DOMAIN"
                            }
                        }
                },
                "type": "start",
                capture: {
                    json : '$',
                    as : 'response'
                }
              }

@neha-2022
Copy link
Author

Hi @hassy, could you please guide/advise me on above issue.
Thanks a lot!!

@hassy
Copy link
Member

hassy commented Aug 18, 2022

@neha-2022 I'm not familiar with AppSync but it looks like it implements a custom application-level protocol on top of WebSockets (which is only used for transport).

You'd need to build a custom AppSync engine for Artillery using the official AppSync client for JS. The Kinesis engine would be a good example to start with: https://github.com/artilleryio/artillery-engine-kinesis

@artilleryio artilleryio locked and limited conversation to collaborators Aug 18, 2022
@hassy hassy converted this issue into discussion #1574 Aug 18, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants