Package org.apache.camel.component.avro
Class AvroListener
- java.lang.Object
-
- org.apache.camel.component.avro.AvroListener
-
public class AvroListener extends Object
This class holds server that listen to given protocol:host:port combination and dispatches messages to different routes mapped.
-
-
Constructor Summary
Constructors Constructor Description AvroListener(AvroEndpoint endpoint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
register(String messageName, AvroConsumer consumer)
Registers consumer by appropriate message name as key in registry.Object
respond(org.apache.avro.Protocol.Message message, Object request, org.apache.avro.specific.SpecificData data)
boolean
unregister(String messageName)
Unregisters consumer by message name.
-
-
-
Constructor Detail
-
AvroListener
public AvroListener(AvroEndpoint endpoint) throws Exception
- Throws:
Exception
-
-
Method Detail
-
register
public void register(String messageName, AvroConsumer consumer) throws AvroComponentException
Registers consumer by appropriate message name as key in registry.- Parameters:
messageName
- message nameconsumer
- avro consumer- Throws:
AvroComponentException
-
unregister
public boolean unregister(String messageName)
Unregisters consumer by message name. Stops server in case if all consumers are unregistered and default consumer is absent or stopped.- Parameters:
messageName
- message name- Returns:
- true if all consumers are unregistered and defaultConsumer is absent or null. It means that this responder can be unregistered.
-
-