FlinkTasksClientFactory

class statefun_tasks.client.FlinkTasksClientFactory

Factory for creating memoized FlinkTasksClients

__init__()

Methods

__init__()

get_client(kafka_broker_url, request_topics, ...)

Creates a FlinkTasksClient for submitting tasks to flink.

static get_client(kafka_broker_url, request_topics, action_topics, reply_topic, serialiser=None, kafka_properties=None, kafka_consumer_properties=None, kafka_producer_properties=None)

Creates a FlinkTasksClient for submitting tasks to flink. Clients are memoized by broker url and reply topic.

Parameters:
  • kafka_broker_url – url of the kafka broker (or list of urls) used for ingress and egress

  • request_topics (dict) – dictionary of worker to ingress topic mappings (use None for default) e.g. {‘example/worker’: ‘example.requests’, None: ‘example.default.requests’}

  • action_toptics – as per request_topics but used for action requests

  • reply_topic – topic to listen on for responses (a unique consumer group id will be created)

  • serialiser (optional) – serialiser to use (will use DefaultSerialiser if not set)

  • kafka_properties (optional) – additional properties to be passed to the KafkaConsumer and KafkaProducer

  • kafka_consumer_properties (optional) – additional properties to be passed to the KafkaConsumer

  • kafka_producer_properties (optional) – additional properties to be passed to the KafkaProducer

Return type:

FlinkTasksClient