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.
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AvroListener
public AvroListener(AvroEndpoint endpoint)
throws Exception
- Throws:
Exception
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.
respond
public Object respond(org.apache.avro.Protocol.Message message,
Object request,
org.apache.avro.specific.SpecificData data)
throws Exception
- Throws:
Exception
Apache Camel