This commit is contained in:
2026-05-13 16:02:50 +07:00
parent c20a266e72
commit 60ae464ea2

View File

@@ -803,14 +803,15 @@ env = smartreceive(msg; fileserver_download_handler=_fetch_with_backoff, max_ret
``` ```
""" """
function smartreceive( function smartreceive(
msg::NATS.Msg; msg_json_str::String; # get it from String(nats_msg.payload)
fileserver_download_handler::Function = _fetch_with_backoff, fileserver_download_handler::Function = _fetch_with_backoff,
max_retries::Int = 5, max_retries::Int = 5,
base_delay::Int = 100, base_delay::Int = 100,
max_delay::Int = 5000 max_delay::Int = 5000
)::JSON.Object{String, Any} )::JSON.Object{String, Any}
# Parse the JSON envelope # Parse the JSON envelope
env_json_obj = JSON.parse(String(msg.payload)) env_json_obj = JSON.parse(msg_json_str)
log_trace(env_json_obj["correlation_id"], "Processing received message") # Log message processing start log_trace(env_json_obj["correlation_id"], "Processing received message") # Log message processing start
# Process all payloads in the envelope # Process all payloads in the envelope