Skip to content
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

How to add custom headers with requestClient? #11

Open
lucfirely opened this issue Mar 1, 2023 · 0 comments
Open

How to add custom headers with requestClient? #11

lucfirely opened this issue Mar 1, 2023 · 0 comments

Comments

@lucfirely
Copy link

lucfirely commented Mar 1, 2023

How can I send custom/extra headers with requestClient?

To clarify I mean the headers in sendContext.ts

let client = bus.requestClient<SubmitOrder, OrderSubmitted>({
    exchange: "orders",
    requestType: new MessageType("SubmitOrder"),
    responseType: new MessageType("OrderSubmitted"),
})

const submitOrder = setInterval(async () => {
    try {
        let response = await client.getResponse({OrderId: Guid.create().toString(), Amount: 123.45})

        console.log("Order submitted", response.message.OrderId)
    }
    catch (e) {
        console.error("failed to submit order", e.message)
    }
}, 1000)

Example code above is from MassTransit/Sample-Node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant