Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
01-17-2023
12:59 AM
- last edited on
04-21-2026
12:45 AM
by
GrazittiAPI
I need to pass headers in order make a WebSocket connection.
How can I do this in NiFi?
Created 01-17-2023 04:29 AM
Here's the way to do it:
Created 01-17-2023 03:01 AM
You can use InvokeHTTP processor wich provide options to handle Header
Thank you
Created 01-17-2023 04:00 AM
@ckumar No, that won't work, I'm trying to invoke a WebSocket URL: wss://api.gemini.com/v1/order/events
InvokeHTTP can't create WebSocket connections.
Created 01-17-2023 04:04 AM
Ah my bad, for the WebSocket end point did you try ConnectWebSocket ?
Created 01-17-2023 04:15 AM
@ckumar Yes, I am using ConnectWebSocket but how do I pass a custom header like X-GEMINI-APIKEY to the initial connection?
Created 01-17-2023 04:29 AM
Here's the way to do it:
Created 01-17-2023 05:58 AM
ConnectWebSocket does not read any details from Flow file attribute from an incoming flow file.
If you are a Cloudera customer, feel free to file a support ticket with us, we should be able to help you on this with a longer engagement.
Thank you
Created 01-18-2023 01:15 AM
@ckumar That is incorrect, the ConnectWebSocket reads attributes from an incoming flow file.
It is also in the documentation that I posted:
I contacted a Cloudera NiFi expert and he confirmed.
The solution I posted is correct.
Created 01-18-2023 01:26 AM
@jacektrocinski Yes, Sir, you are right, I put more focus on read attribute section of the document which has none but missed seeing Additional details.
Kudos!!