diff --git a/new_testFile_large.zip b/new_testFile_large.zip new file mode 100644 index 0000000..56dfcd1 Binary files /dev/null and b/new_testFile_large.zip differ diff --git a/src/NATSBridge.jl b/src/NATSBridge.jl index 6396299..027016d 100644 --- a/src/NATSBridge.jl +++ b/src/NATSBridge.jl @@ -104,7 +104,7 @@ function log_trace(correlation_id::String, message::String) timestamp = Dates.now() # Get current timestamp @info "[$timestamp] [Correlation: $correlation_id] $message" # Log formatted message end -2112 + """ smartsend - Send data either directly via NATS or via a fileserver URL, depending on payload size @@ -358,18 +358,18 @@ function smartreceive( # Deserialize based on type data = _deserialize_data(payload_bytes, env.type, env.correlation_id, env.metadata) # Convert bytes to Julia data - + return (data = data, envelope = env) # Return data and envelope as tuple elseif env.transport == "link" # Link transport - payload is at URL log_trace(env.correlation_id, "Link transport - fetching from URL") # Log link transport handling # 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 - 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 error("Unknown transport type: $(env.transport)") # Throw error for unknown transport end diff --git a/test/test_julia_julia_data_transfer.jl b/test/test_julia_julia_data_transfer.jl index 00b4d7a..aeeff59 100644 --- a/test/test_julia_julia_data_transfer.jl +++ b/test/test_julia_julia_data_transfer.jl @@ -104,7 +104,7 @@ function test_large_binary_receive() end # Keep listening for 10 seconds - sleep(60) + sleep(120) NATS.drain(conn) end