NiteLordz
NiteLordz

Reputation: 607

Load testing with Bot Framework

I have debugged thru the process of getting an auth token, and i am able to pass an activity from a console application to a custom connector web api. From there i need to pass the activity to my bot, however, this is where i am running into a problem.

When i send my payload to my bot service end point (https://localhost:3979/api/messages) i am getting a 500 internal service error. using Postman, i am able to debug into the bot service, and see that i am getting an error of

Exception thrown: 'Microsoft.Rest.SerializationException' in mscorlib.dll

following the stack trace, i see "Unexpected character while parsing...". This occurs during the following call.

await dialogContext.PostAsync("Testing 123");

If i use the payload that is sent from the emulator, it works properly. However, if i change ChannelId to "test" and my ServiceUrl to my custom connector service, i get the error mentioned above.

I am debugging all services locally to get the pipeline setup properly.

Custom Connector Service url is using SSL (https).

What piece of the puzzle am i missing?

Upvotes: 0

Views: 1245

Answers (2)

NiteLordz
NiteLordz

Reputation: 607

The problem i was having was in one of the responses. When i returned an id value, it was already encoded, but when it passed through the apicontroller, it was encoded again, therefore, the bot framework was not able to parse it properly.

Instead of returning a string of json (hardcoded as in the sample), i created a ResourceResponse object from the bot framework (https://docs.botframework.com/en-us/csharp/builder/sdkreference/de/df8/class_microsoft_1_1_bot_1_1_connector_1_1_resource_response.html) which only contains an ID field, but it's what was expected. This resolved my communication issue from custom connector to bot framework to custom connector.

Upvotes: 0

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

Take a look to https://github.com/thirumathi/bottestvsts, where you will find an approach for doing load testing.

In particular, at https://github.com/thirumathi/bottestvsts/tree/master/BotCustomConnectorSvc you will find a custom implementation of the connector and the state.

Upvotes: 1

Related Questions