Azure / Azure/azure-functions-host
Custom runtime Eventhub trigger not receiving additional events after the initial call
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
#### Is your question related to a specific version? If so, please specify:
No, not that I'm aware of.
#### What language does your question apply to? (e.g. C#, JavaScript, Java, All)
Rust with the Custom runtime
#### Question
I have defined an EventHubTrigger:
```json
{
"bindings": [
{
"type": "eventHubTrigger",
"name": "eventHubMessages",
"direction": "in",
"eventHubName": "",
"connection": "",
"cardinality": "many",
"consumerGroup": "$Default"
}
]
}
```
but when the following snippet runs:
```rust
#[tokio::main]
async fn main() {
SimpleLogger::new().init().unwrap();
let example1 = warp::body::json().and_then(|j: serde_json::Value| async move {
log::info!("Got a request.");
log::warn!("Sending response!");
Result::<_, Rejection>::Ok(warp::reply())
});
let port_key = "FUNCTIONS_CUSTOMHANDLER_PORT";
let port: u16 = match env::var(port_key) {
Ok(val) => val.parse().expect("Custom Handler port is not a number!"),
Err(_) => 3000,
};
warp::serve(example1)
.run((Ipv4Addr::UNSPECIFIED, port))
.await
}
```
I can see that an initial request is processed (I see `Sending response!` loggings, but no additional messages are taken from event hub and it seems to wait indefinitely. I suspect that I might have to send something back instead of a `200 OK`, but I don't see what.
I've logged the request to a file once, and it contains the messages and metadata as expected.
I can't find any information about having to respond in a certain way or what can cause this to hang? I've also tested with Postman and the request completes very quickly, so it's not like it's hanging after exiting `and_then`.
Running a C# one after this processes additional requests so it's not like there are no requests to handle.
Contributor guide
Research direction
Start with the EventHubTrigger binding and the Rust custom runtime handler using warp, including the FUNCTIONS_CUSTOMHANDLER_PORT entry point and the logged request payload. Investigate the custom runtime response behavior and request lifecycle, comparing the Rust handler with the working C# function; done means additional Event Hub messages are processed after the initial request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, rust
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100