add_mix_content_capability #2

Merged
ton merged 25 commits from add_mix_content_capability into main 2026-02-19 12:27:59 +00:00
3 changed files with 14 additions and 13 deletions
Showing only changes of commit 483caab54c - Show all commits

BIN
new_testFile_small.zip Normal file

Binary file not shown.

View File

@@ -571,9 +571,7 @@ function smartreceive(
)
# Parse the JSON envelope
json_data = JSON.parse(String(msg.payload))
println("R1 ----------")
PrettyPrinting.pprintln(json_data)
println("R1 ==========")
log_trace(json_data["correlationId"], "Processing received message") # Log message processing start
# Process all payloads in the envelope
@@ -605,9 +603,7 @@ function smartreceive(
log_trace(json_data["correlationId"], "Link transport - fetching '$dataname' from URL") # Log link transport handling
# Extract download URL from the payload
println("R2 ----------")
PrettyPrinting.pprintln(payload)
println("R2 ==========")
url = String(payload["data"])
# Fetch with exponential backoff using the download handler

View File

@@ -26,9 +26,6 @@ correlation_id = string(uuid4())
# test file transfer #
# ------------------------------------------------------------------------------------------------ #
# File path for large binary payload test
const FILE_PATH = "./testFile_large.zip"
const filename = basename(FILE_PATH)
# Helper: Log with correlation ID
function log_trace(message)
@@ -65,18 +62,27 @@ end
# Sender: Send large binary file via smartsend
function test_large_binary_send()
# Read the large file as binary data
log_trace("Reading file: $FILE_PATH")
file_data = read(FILE_PATH)
file_size = length(file_data)
log_trace("File size: $file_size bytes")
# test data 1
file_path1 = "./testFile_large.zip"
file_data1 = read(file_path1)
filename1 = basename(file_path1)
data1 = (filename1, file_data1, "binary")
# test data 2
file_path2 = "./testFile_small.zip"
file_data2 = read(file_path2)
filename2 = basename(file_path2)
data2 = (filename2, file_data2, "binary")
# Use smartsend with binary type - will automatically use link transport
# if file size exceeds the threshold (1MB by default)
# API: smartsend(subject, [(dataname, data, type), ...]; keywords...)
env = NATSBridge.smartsend(
SUBJECT,
[(filename, file_data, "binary")], # List of (dataname, data, type) tuples
[data1, data2], # List of (dataname, data, type) tuples
nats_url = NATS_URL;
fileserver_url = FILESERVER_URL,
fileserverUploadHandler = plik_upload_handler,
@@ -105,7 +111,6 @@ end
# Run the test
println("Starting large binary payload test...")
println("Correlation ID: $correlation_id")
println("File: $FILE_PATH")
# Run sender first
println("start smartsend")