test_smartreceive_function #1
BIN
new_testFile_large.zip
Normal file
BIN
new_testFile_large.zip
Normal file
Binary file not shown.
@@ -104,7 +104,7 @@ function log_trace(correlation_id::String, message::String)
|
|||||||
timestamp = Dates.now() # Get current timestamp
|
timestamp = Dates.now() # Get current timestamp
|
||||||
@info "[$timestamp] [Correlation: $correlation_id] $message" # Log formatted message
|
@info "[$timestamp] [Correlation: $correlation_id] $message" # Log formatted message
|
||||||
end
|
end
|
||||||
2112
|
|
||||||
|
|
||||||
""" smartsend - Send data either directly via NATS or via a fileserver URL, depending on payload size
|
""" smartsend - Send data either directly via NATS or via a fileserver URL, depending on payload size
|
||||||
|
|
||||||
@@ -364,12 +364,12 @@ function smartreceive(
|
|||||||
log_trace(env.correlation_id, "Link transport - fetching from URL") # Log link transport handling
|
log_trace(env.correlation_id, "Link transport - fetching from URL") # Log link transport handling
|
||||||
|
|
||||||
# Fetch with exponential backoff
|
# Fetch with exponential backoff
|
||||||
data = _fetch_with_backoff(env.url, max_retries, base_delay, max_delay, env.correlation_id) # Fetch data from URL
|
downloaded_data = _fetch_with_backoff(env.url, max_retries, base_delay, max_delay, env.correlation_id) # Fetch data from URL
|
||||||
|
|
||||||
# Deserialize based on type
|
# Deserialize based on type
|
||||||
result = _deserialize_data(data, env.type, env.correlation_id, env.metadata) # Convert bytes to Julia data
|
data = _deserialize_data(downloaded_data, env.type, env.correlation_id, env.metadata) # Convert bytes to Julia data
|
||||||
|
|
||||||
return (data = result, envelope = env) # Return data and envelope as tuple
|
return (data = data, envelope = env) # Return data and envelope as tuple
|
||||||
else # Unknown transport type
|
else # Unknown transport type
|
||||||
error("Unknown transport type: $(env.transport)") # Throw error for unknown transport
|
error("Unknown transport type: $(env.transport)") # Throw error for unknown transport
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function test_large_binary_receive()
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Keep listening for 10 seconds
|
# Keep listening for 10 seconds
|
||||||
sleep(60)
|
sleep(120)
|
||||||
NATS.drain(conn)
|
NATS.drain(conn)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user