Search in sources :

Example 76 with MessageConsumer

use of io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer in project zilla by aklivity.

the class KafkaMergedFactory method doBegin.

private void doBegin(MessageConsumer receiver, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity, Flyweight.Builder.Visitor extension) {
    final BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).extension(b -> b.set(extension)).build();
    receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
}
Also used : BindingHandler(io.aklivity.zilla.runtime.engine.binding.BindingHandler) KafkaBinding(io.aklivity.zilla.runtime.binding.kafka.internal.KafkaBinding) MessageConsumer(io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer) Flyweight(io.aklivity.zilla.runtime.binding.kafka.internal.types.Flyweight) UnsafeBuffer(org.agrona.concurrent.UnsafeBuffer) KafkaFetchDataExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaFetchDataExFW) KafkaBeginExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaBeginExFW) KafkaBindingConfig(io.aklivity.zilla.runtime.binding.kafka.internal.config.KafkaBindingConfig) Array32FW(io.aklivity.zilla.runtime.binding.kafka.internal.types.Array32FW) DEFAULT_MINIMUM(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.WindowFW.Builder.DEFAULT_MINIMUM) KafkaDeltaFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaDeltaFW) KafkaKeyFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaKeyFW) KafkaResetExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaResetExFW) PRODUCE_ONLY(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaCapabilities.PRODUCE_ONLY) KafkaValueMatchFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaValueMatchFW) KafkaFilterFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaFilterFW) KafkaOffsetFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetFW) ResetFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.ResetFW) KafkaMergedFlushExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaMergedFlushExFW) EngineContext(io.aklivity.zilla.runtime.engine.EngineContext) EndFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.EndFW) KafkaHeaderFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaHeaderFW) KafkaDataExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaDataExFW) Objects(java.util.Objects) FETCH_ONLY(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaCapabilities.FETCH_ONLY) List(java.util.List) KafkaMergedBeginExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaMergedBeginExFW) HISTORICAL(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType.HISTORICAL) String16FW(io.aklivity.zilla.runtime.binding.kafka.internal.types.String16FW) MergedBudgetCreditor(io.aklivity.zilla.runtime.binding.kafka.internal.budget.MergedBudgetCreditor) MutableDirectBuffer(org.agrona.MutableDirectBuffer) Long2LongHashMap(org.agrona.collections.Long2LongHashMap) KafkaConditionFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaConditionFW) KafkaNotFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaNotFW) KafkaMetaDataExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaMetaDataExFW) DirectBuffer(org.agrona.DirectBuffer) DataFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.DataFW) Int2IntHashMap(org.agrona.collections.Int2IntHashMap) LIVE(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType.LIVE) ArrayList(java.util.ArrayList) ArrayFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.ArrayFW) KafkaCapabilities(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaCapabilities) OctetsFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.OctetsFW) KafkaOffsetType(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetType) KafkaFlushExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaFlushExFW) AbortFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.AbortFW) MutableInteger(org.agrona.collections.MutableInteger) KafkaMergedDataExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaMergedDataExFW) NO_CREDITOR_INDEX(io.aklivity.zilla.runtime.engine.budget.BudgetCreditor.NO_CREDITOR_INDEX) FlushFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.FlushFW) KafkaConfiguration(io.aklivity.zilla.runtime.binding.kafka.internal.KafkaConfiguration) WindowFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.WindowFW) LongFunction(java.util.function.LongFunction) KafkaPartitionFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaPartitionFW) KafkaConfigFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaConfigFW) KafkaHeadersFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaHeadersFW) LongConsumer(java.util.function.LongConsumer) BeginFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.BeginFW) Consumer(java.util.function.Consumer) KafkaDeltaType(io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaDeltaType) LongUnaryOperator(java.util.function.LongUnaryOperator) Collections(java.util.Collections) ExtensionFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.ExtensionFW) KafkaDescribeDataExFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaDescribeDataExFW) BeginFW(io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.BeginFW)

Example 77 with MessageConsumer

use of io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer in project zilla by aklivity.

the class ProxyClientFactory method newStream.

private MessageConsumer newStream(MessageConsumer sender, long routeId, long streamId, long sequence, long acknowledge, int maximum, long traceId, long authorization, long affinity) {
    BeginFW begin = beginRW.wrap(writeBuffer, 0, writeBuffer.capacity()).routeId(routeId).streamId(streamId).sequence(sequence).acknowledge(acknowledge).maximum(maximum).traceId(traceId).authorization(authorization).affinity(affinity).build();
    MessageConsumer receiver = streamFactory.newStream(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof(), sender);
    receiver.accept(begin.typeId(), begin.buffer(), begin.offset(), begin.sizeof());
    return receiver;
}
Also used : MessageConsumer(io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer) BeginFW(io.aklivity.zilla.runtime.binding.proxy.internal.types.stream.BeginFW)

Aggregations

MessageConsumer (io.aklivity.zilla.runtime.engine.binding.function.MessageConsumer)77 BeginFW (io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.BeginFW)31 OctetsFW (io.aklivity.zilla.runtime.binding.kafka.internal.types.OctetsFW)17 ExtensionFW (io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.ExtensionFW)17 KafkaBeginExFW (io.aklivity.zilla.runtime.binding.kafka.internal.types.stream.KafkaBeginExFW)17 KafkaBindingConfig (io.aklivity.zilla.runtime.binding.kafka.internal.config.KafkaBindingConfig)14 String16FW (io.aklivity.zilla.runtime.binding.kafka.internal.types.String16FW)14 BindingHandler (io.aklivity.zilla.runtime.engine.binding.BindingHandler)13 KafkaRouteConfig (io.aklivity.zilla.runtime.binding.kafka.internal.config.KafkaRouteConfig)11 BindingConfig (io.aklivity.zilla.runtime.engine.config.BindingConfig)10 MutableDirectBuffer (org.agrona.MutableDirectBuffer)10 EngineContext (io.aklivity.zilla.runtime.engine.EngineContext)9 LongUnaryOperator (java.util.function.LongUnaryOperator)9 DirectBuffer (org.agrona.DirectBuffer)9 UnsafeBuffer (org.agrona.concurrent.UnsafeBuffer)9 KafkaCache (io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCache)6 KafkaCacheTopic (io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCacheTopic)6 KafkaCachePartition (io.aklivity.zilla.runtime.binding.kafka.internal.cache.KafkaCachePartition)4 KafkaOffsetFW (io.aklivity.zilla.runtime.binding.kafka.internal.types.KafkaOffsetFW)4 BeginFW (io.aklivity.zilla.runtime.binding.tls.internal.types.stream.BeginFW)4