Member since
08-05-2019
3
Posts
0
Kudos Received
0
Solutions
10-22-2019
02:16 AM
Hey Matt, Thanks for your reply. This really helps a lot. If this leads to a solution, I will post the results here and accept as solution. Best, Tine
... View more
10-21-2019
07:36 AM
Dear NiFi enthousiasts, I'm configuring a flow where I make a connection with several websockets. Each ws-url contains a unique authentication token obtained via a seperate http-request and is now manually added to the ws-url. Whenever the connection is lost for more than 20 min, my token becomes invalid and I have to manually request new tokes and update the JettyWebSocketClient for each of the websocket connections. this is time consuming and error-prone. To avoid this, I would like to automate this. I was thinking I could store the token in an attribute and pass it to the controller but apparently you cannot pass flow-file attributes to a controller. And on top of that you have to disable before you can update. So, the question is, how can I update the ws-url in the JettyWebSocketClient with new tokens? In order to get the tokens, I need to do a http GET request with x-www-form-urlencoded headers, a signIn command, username and password. This returns a JSON with the token. I replaced the real token with "token". {
"data": {
"clientToken": "token"
}
} websocket-url: ws://{url:port}/api/v1/......X-AUTHENTICATION-TOKEN={token} flow
... View more
Labels:
- Labels:
-
Apache NiFi