diff --git a/README.md b/README.md index efe4442..164fc1b 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ _If a station already exists nothing happens, the new configuration will not be ```python station = memphis.station( name="", - schema_name="", + schema_name="", # defaults to "" (no schema) retention_type=Retention.MAX_MESSAGE_AGE_SECONDS, # MAX_MESSAGE_AGE_SECONDS/MESSAGES/BYTES/ACK_BASED(cloud only). Defaults to MAX_MESSAGE_AGE_SECONDS retention_value=604800, # defaults to 604800 storage_type=Storage.DISK, # Storage.DISK/Storage.MEMORY. Defaults to DISK @@ -118,8 +118,9 @@ station = memphis.station( idempotency_window_ms=120000, # defaults to 2 minutes send_poison_msg_to_dls=True, # defaults to true send_schema_failed_msg_to_dls=True, # defaults to true - tiered_storage_enabled=False # defaults to false - partitions_number=1 # default to 1 + tiered_storage_enabled=False, # defaults to false + partitions_number=1, # defaults to 1 + dls_station="" # defaults to "" (no DLS station) - If selected DLS events will be sent to selected station as well ) ``` diff --git a/memphis/memphis.py b/memphis/memphis.py index c0a0e2a..74f039a 100644 --- a/memphis/memphis.py +++ b/memphis/memphis.py @@ -241,7 +241,8 @@ async def station( send_poison_msg_to_dls: bool = True, send_schema_failed_msg_to_dls: bool = True, tiered_storage_enabled: bool = False, - partitions_number = 1, + partitions_number: int = 1, + dls_station: str = "", ): """Creates a station. Args: @@ -252,6 +253,11 @@ async def station( replicas (int, optional):number of replicas for the messages of the data. Defaults to 1. idempotency_window_ms (int, optional): time frame in which idempotent messages will be tracked, happens based on message ID Defaults to 120000. schema_name (str): schema name. + send_poison_msg_to_dls (bool): whether unacked(poison) messages (reached the max deliveries) should be sent into the DLS. Defaults to True. + send_schema_failed_msg_to_dls (bool): whether schema violation messages should be sent into the DLS. Defaults to True. + tiered_storage_enabled (bool): if true + tiered storage configured - messages hit the retention will be moved into tier 2 storage. Defaults to False. + partitions_number (int): number of partitions for the station. Defaults to 1. + dls_station (str): If selected DLS events will be sent to selected station as well. Defaults to "". Returns: object: station """ @@ -275,7 +281,8 @@ async def station( }, "username": self.username, "tiered_storage_enabled": tiered_storage_enabled, - "partitions_number" : partitions_number + "partitions_number" : partitions_number, + "dls_station": dls_station } create_station_req_bytes = json.dumps(create_station_req, indent=2).encode( "utf-8"