Comments (5)
thanks for raising this and pinging me. I'm muy interested this thread!
from azure-event-hubs-java.
An instance of EventProcessorHost creates an instance of IEventProcessor for every partition that it holds the lease for. A given instance of IEventProcessor is created when the EPH instance gets the lease for a partition and is permanently tied to that partition, being shut down and destroyed if and when the EPH instance loses the lease, or the EPH instance as a whole is shut down.
The loop at PartitionManager.java:423 iterates through all the leases and calls Pump.addPump() for each partition that this EPH instance owns. If there already is a pump for that partition, Pump checks its health and restarts if necessary (Pump.java:42); if there isn't one, it creates a new pump (Pump.java:54). Pump.createNewPump() creates a new instance of EventHubPartitionPump and starts it at Pump.java:60-61. The method startPump() is actually implemented on the parent class PartitionPump, and the processor factory is called to create a new IEventProcessor at PartitionPump.java:52.
from azure-event-hubs-java.
Thanks James.
This does not corroborate with my observations. As I said, constructor of my IEventProcessor
gets called once while I have a single host working off 8 partitions. I guess the next step is to have a repro?
from azure-event-hubs-java.
A moment of clarification: what I describe is the behavior of the default IEventProcessorFactory. If you implement your own and call EventProcessorHost.RegisterEventProcessorFactory with it, then any pattern is possible. A user-implemented factory is free to only ever create one IEventProcessor instance and just dispense that instance whenever it is called to create an event processor. We have heard from customers who are doing exactly that.
I assuming that you are NOT doing a custom factory -- if you were, you'd know why your constructor was being called only once! For the default factory, the behavior is supposed to be as I describe, and if you can repro it failing, we would love to see that and fix it.
Thanks!
from azure-event-hubs-java.
Thanks James.
You are absolutely correct. I created a bare-bone example and I can see, as you said, we get an instance per partition.
from azure-event-hubs-java.
Related Issues (20)
- EPH library does not expose metadata about event hub partitions HOT 4
- Client side logging sent messages HOT 1
- Azure eventhub Kafka org.apache.kafka.common.errors.TimeoutException for some of the records HOT 1
- Resilience4J HOT 1
- Vulnerability in dependency adapter-rxjava-2.4.0 HOT 5
- How to get the params in the samples? HOT 8
- IEventProcessor#onClose not being called during graceful shutdown HOT 5
- Support larger payload for Event Hub Standard HOT 7
- Load balancing for event processor failed
- EventProcessorClient doesn't alert or throw an exception when underlying connection times out HOT 2
- [Bug Report] Connection drops after a few hours ("force detached. Code: RenewToken") HOT 3
- Azure Stack Hub#Could not send messages. HOT 2
- Did not observe any item or terminal signal within 4000ms in 'takeUntil' HOT 1
- Java WebApp and Managed Identity
- Question! How can I use `EventProcessorClient` on Spring Boot HOT 1
- EventData constructor hangs HOT 1
- On AmqpException exception HOT 1
- Is publisher policy together with partition key/partition number specification now possible?
- This repo is missing important files HOT 1
- Connecting Servicebus through Async client failed: exception occurred while processing events. java.lang.NullPointerException: uncorrelated channel:0: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-event-hubs-java.