Member since
05-20-2022
66
Posts
6
Kudos Received
6
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1222 | 07-17-2023 11:25 PM | |
1211 | 04-17-2023 02:29 PM | |
5801 | 02-15-2023 08:47 PM | |
934 | 02-08-2023 06:02 PM | |
4595 | 10-17-2022 11:48 AM |
04-04-2023
01:57 PM
Hello, I am attempting to use the NiFi ConnectWebSocket processor but not having any luck. I have my JettyWebSocketClient WebSocket URI set to my web socket url. Then I configure the ConnectWebSocket with the JettyWebSocketClient, and set the "WebSocket Client Id" to a unique name. Seemingly all very simple, however, it ain't working for me. What am I doing wrong here; why can't I receive the web socket data?
... View more
Labels:
- Labels:
-
Apache NiFi
02-15-2023
08:47 PM
I figured this out. The problem was that I was missing two things. 1. I need another processor BEFORE the InvokeHTTP processor to send in a flow file and trigger the InvokeHTTP processor. Seems obvious now, but didn't dawn on me at the time. 2. I need the sql query to be in the body of the flow file, which I accomplish by using a GenerateFlowFile processor in front of the InvokeHTTP processor, and then set the "Custom Text" field to my SQL query. This also satisfies the first requirement of needing an incoming flow file to trigger the InvokeHTTP processor. It is literally that simple. I didn't need to specify the attributes to include or anything else. However, I did specify the Content-Type as "text/plain".
... View more
02-08-2023
06:02 PM
1 Kudo
I resorted to using an Avro schema with the RecordsetWriter in order to coerce the values into numbers. So even though the documentation says toNumber's return type is "Number", it doesn't get expressed that way. But the schema fixes it so its all good.
... View more
02-08-2023
02:44 PM
When attempting to insert a timestamp in milliseconds into a flowfile using the UpdateRecord processor, the timestamp comes out expressed as a string (first image) despite the fact that I've explicitly cast it as a number (second image). How can I get this expressed as a number like it is supposed to?
... View more
Labels:
- Labels:
-
Apache NiFi
02-03-2023
12:29 PM
Yes, I am certain. Let me explain why and share what I've done so far. 1. When I attempt to monitor the network traffic, I can't see the outgoing payload from my browser because the call is made from the server, however, I can see 401 and a 403 errors returned. 2. I can change the REST endpoint to one that uses a GET and this works fine 3. I can POST a write operation, and that works fine 4. I used the PostHTTP processor, and this processor actually correctly returns the 401 and 403 Responses, so this confirms what I saw via the network traffic So at this point I am certain the issue is an authentication issue. But why? I'm using "OAuth2 Access Token" successfully in every other instance with this API. So I experimented with the PostHTTP processor by adding the token as an attribute to pass along. That still didn't work. What is the correct way to manually submit an authorization token? Is there any way for me to log these HTTP calls from within NiFi?
... View more
02-03-2023
10:37 AM
Thanks SAMSAL. To clarify, I am not sending query parameters. I am attempting to perform a POST so I need to specify my parameter as an attribute. I changed the "Always Output Response" to True which seems like a good idea but unfortunately that didn't change anything. Which is really weird, because I should be betting some sort of response. Is there any way I can see the HTTP payload that NiFi submits? I've combed through the log files and I can't find any references to InvokeHTTP traffic. If I could review the payload then I can figure out what is messed up. Any ideas about how to view the HTTP traffic?
... View more
02-02-2023
07:03 PM
It seems this question gets asked a lot in this forum, but there aren't any good responses. Hopefully somebody can help me out here. I am attempting to use the InvokeHTTP processor to POST a query to an REST endpoint. I currently use the InvokeHTTP processor to access data on this data service using the GET method, and that always works fine. However, there is a specific service endpoint that only accepts POST requests. I've verified this service is functional using curl. But when I attempt to use the NiFi InvokeHTTP processor, I get no response. Hopefully somebody here knows what's going on. Below are some screen shots of my processor configuration. If I understand the documentation correctly, I need to specify in the "Attributes to Send" field the flowfile attributes I want to send as parameters. Since this processor is the first processor in the flow, it does't have any attributes yet, so I add a dynamic attribute named "data" (shown at the bottom). Then I reference that attribute in the "Attributes to Send" field. Seems correct per the documentation. But it don't work. In fact I get no response at all, not even a 400 series response. What am I missing here? This seems like it should be really simple, but yet is bedeviling me.
... View more
Labels:
- Labels:
-
Apache NiFi
02-02-2023
09:12 AM
Hi @SAMSAL , Ugh! That is a little disconcerting to hear about the "wrapper" and "insertion" strategies. I resorted to using the "wrapper" strategy and then follow up with a Jolt transform to get the data into the format I want. However, if you think using SQL is a more bullet proof option then I'm open to that if you know how to write a SQL that uses RecordPath to put the data into the structure I need. Here is an example dataset, which gives me the exact same outcome. The incoming flow file is OpenSky flight data, and the primary key is "hex". Using an UpdateRecord processor, I add the field "aircraft": "placeholder" because the JoinEnrichment processor requires that the field already exist before inserting the enrichment data. The second dataset is my enrichment data, which is a record in a large dataset called UnitedAirlinesFleet, and "icao24" is the foreign key. So "hex" and "icao24" are the two keys. I want to do something very simple, which is to insert the enrichment data into flight data as a record where the field name is "aircraft", as shown in the third dataset below. I believe this is precisely what the insertion strategy is designed to do. I really appreciate you SAMSAL and your expertise. Your suggestion to use the ForkEnrichment and JoinEnrichment was really helpful. I subsequently found a Cloudera video on this topic and that also helped a lot with how to structure the flow. Thank you. {
"hex" : "a39fb1",
"flight" : "UAL798 ",
"alt_baro" : 23000,
"alt_geom" : 23200,
"gs" : 415.2,
"track" : 275.9,
"baro_rate" : 2432,
"squawk" : "1467",
"emergency" : "none",
"category" : "A3",
"nav_qnh" : 1013.6,
"nav_altitude_mcp" : 26016,
"nav_heading" : 270.0,
"lat" : 39.969681,
"lon" : -105.610657,
"nic" : 8,
"rc" : 186,
"seen_pos" : 1.1,
"version" : 2,
"nic_baro" : 1,
"nac_p" : 9,
"nac_v" : 1,
"sil" : 3,
"sil_type" : "perhour",
"gva" : 2,
"sda" : 2,
"mlat" : [ ],
"tisb" : [ ],
"messages" : 876,
"seen" : 1.1,
"rssi" : -1.8,
"aircraft" : "placeholder"
} {
"icao24" : "a39fb1",
"registration" : "N33203",
"manufacturericao" : "BOEING",
"manufacturername" : "Boeing",
"model" : "737-824",
"typecode" : "B738",
"serialnumber" : 30613,
"linenumber" : null,
"icaoaircrafttype" : "L2J",
"operator" : null,
"operatorcallsign" : "UNITED",
"operatoricao" : "UAL",
"operatoriata" : null,
"owner" : "Wells Fargo Trust Co Na Trustee",
"testreg" : null,
"registered" : null,
"reguntil" : "2023-07-31",
"status" : null,
"built" : "2000-01-01",
"firstflightdate" : null,
"seatconfiguration" : null,
"engines" : "CFM INTL. CFM56 SERIES",
"modes" : false,
"adsb" : false,
"acars" : false,
"notes" : null,
"categoryDescription" : "No ADS-B Emitter Category Information"
} {
"hex" : "a39fb1",
"flight" : "UAL798 ",
"alt_baro" : 23000,
"alt_geom" : 23200,
"gs" : 415.2,
"track" : 275.9,
"baro_rate" : 2432,
"squawk" : "1467",
"emergency" : "none",
"category" : "A3",
"nav_qnh" : 1013.6,
"nav_altitude_mcp" : 26016,
"nav_heading" : 270.0,
"lat" : 39.969681,
"lon" : -105.610657,
"nic" : 8,
"rc" : 186,
"seen_pos" : 1.1,
"version" : 2,
"nic_baro" : 1,
"nac_p" : 9,
"nac_v" : 1,
"sil" : 3,
"sil_type" : "perhour",
"gva" : 2,
"sda" : 2,
"mlat" : [ ],
"tisb" : [ ],
"messages" : 876,
"seen" : 1.1,
"rssi" : -1.8,
"aircraft" : {
"icao24" : "a39fb1",
"registration" : "N33203",
"manufacturericao" : "BOEING",
"manufacturername" : "Boeing",
"model" : "737-824",
"typecode" : "B738",
"serialnumber" : 30613,
"linenumber" : null,
"icaoaircrafttype" : "L2J",
"operator" : null,
"operatorcallsign" : "UNITED",
"operatoricao" : "UAL",
"operatoriata" : null,
"owner" : "Wells Fargo Trust Co Na Trustee",
"testreg" : null,
"registered" : null,
"reguntil" : "2023-07-31",
"status" : null,
"built" : "2000-01-01",
"firstflightdate" : null,
"seatconfiguration" : null,
"engines" : "CFM INTL. CFM56 SERIES",
"modes" : false,
"adsb" : false,
"acars" : false,
"notes" : null,
"categoryDescription" : "No ADS-B Emitter Category Information"
}
}
... View more
02-01-2023
03:49 PM
I am using a ForkEnrichment - JoinEnrichment combo to enrich some data. Within the JoinEnrichment processor, the "wrapper" and "sql" options for the "Join Strategy" both work fine. However, the "insert enrichment fields" option doesn't. I prefer this option because I want my enrichment data to be a nested dataset off one of the root fields. The field exists in the original data, and is properly referenced in the "Insertion Record Path" field. So... I'm scratching my head trying to figure out why this isn't working. Anyone experience this or have any ideas?
... View more
Labels:
- Labels:
-
Apache NiFi
01-31-2023
11:01 AM
Thank you @SAMSAL I will investigate these processors; I had no idea they existed. Thank you!
... View more