Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/signoffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event_name == 'pull_request'
run: |
for commit in $(git rev-list "origin/${{ github.base_ref }}".."${{ github.event.pull_request.head.sha }}"); do
if ! git verify-commit --raw $commit 2>&1 | grep -q SIG; then
if ! git verify-commit --raw $commit 2>&1 | grep -iq SIG; then
echo "--------------------------------------------------------------"
echo "Error: Commit $commit is not signed using GPG, SSH, or S/MIME"
echo "https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits"
Expand Down
10 changes: 5 additions & 5 deletions src/NATS.Client.JetStream/NatsJSContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public async ValueTask<NatsResult<PubAckResponse>> TryPublishAsync<T>(
requestSerializer: serializer,
replySerializer: NatsJSJsonSerializer<PubAckResponse>.Default,
requestOpts: opts,
replyOpts: new NatsSubOpts { Timeout = Connection.Opts.RequestTimeout },
replyOpts: new NatsSubOpts { Timeout = Opts.RequestTimeout },
cancellationToken).ConfigureAwait(false);
}
catch (NatsNoReplyException)
Expand Down Expand Up @@ -223,7 +223,7 @@ public async ValueTask<NatsResult<PubAckResponse>> TryPublishAsync<T>(
// is a reconnect to the cluster between the request and waiting for a response,
// without the timeout the publish call will hang forever since the server
// which received the request won't be there to respond anymore.
Timeout = Connection.Opts.RequestTimeout,
Timeout = Opts.RequestTimeout,
},
cancellationToken)
.ConfigureAwait(false);
Expand Down Expand Up @@ -314,7 +314,7 @@ public async ValueTask<NatsJSPublishConcurrentFuture> PublishConcurrentAsync<T>(
// is a reconnect to the cluster between the request and waiting for a response,
// without the timeout the publish call will hang forever since the server
// which received the request won't be there to respond anymore.
Timeout = Connection.Opts.RequestTimeout,
Timeout = Opts.RequestTimeout,

// If JetStream is disabled, a no responders error will be returned
// No responders error might also happen when reconnecting to cluster
Expand Down Expand Up @@ -403,7 +403,7 @@ internal async ValueTask<NatsResult<NatsJSResponse<TResponse>>> TryJSRequestAsyn
subject: subject,
data: request,
headers: null,
replyOpts: new NatsSubOpts { Timeout = Connection.Opts.RequestTimeout },
replyOpts: new NatsSubOpts { Timeout = Opts.RequestTimeout },
requestSerializer: NatsJSJsonSerializer<TRequest>.Default,
replySerializer: NatsJSJsonDocumentSerializer<TResponse>.Default,
cancellationToken: cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -444,7 +444,7 @@ internal async ValueTask<NatsResult<NatsJSResponse<TResponse>>> TryJSRequestAsyn
subject: subject,
data: request,
headers: default,
replyOpts: new NatsSubOpts { Timeout = Connection.Opts.RequestTimeout },
replyOpts: new NatsSubOpts { Timeout = Opts.RequestTimeout },
requestSerializer: NatsJSJsonSerializer<TRequest>.Default,
replySerializer: NatsJSJsonDocumentSerializer<TResponse>.Default,
cancellationToken: cancellationToken)
Expand Down
8 changes: 7 additions & 1 deletion src/NATS.Client.JetStream/NatsJSOpts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace NATS.Client.JetStream;
/// </summary>
public record NatsJSOpts
{
public NatsJSOpts(NatsOpts opts, string? apiPrefix = default, string? domain = default, AckOpts? ackOpts = default)
public NatsJSOpts(NatsOpts opts, string? apiPrefix = default, string? domain = default, AckOpts? ackOpts = default, TimeSpan? requestTimeout = default)
{
if (apiPrefix != null && domain != null)
{
Expand All @@ -17,6 +17,7 @@ public NatsJSOpts(NatsOpts opts, string? apiPrefix = default, string? domain = d

ApiPrefix = apiPrefix ?? "$JS.API";
Domain = domain;
RequestTimeout = requestTimeout ?? opts.RequestTimeout;
}

/// <summary>
Expand All @@ -34,6 +35,11 @@ public NatsJSOpts(NatsOpts opts, string? apiPrefix = default, string? domain = d
/// </summary>
public string? Domain { get; }

/// <summary>
/// Timeout for JetStream API calls.
/// </summary>
public TimeSpan RequestTimeout { get; }

/// <summary>
/// Ask server for an acknowledgment.
/// </summary>
Expand Down
Loading