The user should be able to add listeners on a connection to check the changing of a connection state
const connection = await environment.createConnection({ changeStateListener: ( sender, fromState, toState, error) => /*...*/ })
Same for a publisher
const publisher = await connection.createPublisher({
queue: { name: "test-queue" },
changeStateListener: ( sender, fromState, toState, error) => /*...*/
})
Same for a consumer
const consumer = await connection.createConsumer(
"test-queue",
{
messageHandler: (msg) => /*...*/,
changeStateListener: ( sender, fromState, toState, error) => /*...*/
}
)