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 Details

  • Method Details

    • register

      public void register(String messageName, AvroConsumer consumer) throws AvroComponentException
      Registers consumer by appropriate message name as key in registry.
      Parameters:
      messageName - message name
      consumer - 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
    • createExchange

      protected static org.apache.camel.Exchange createExchange(AvroConsumer consumer, org.apache.avro.Protocol.Message message, Object request)