Skip to content

Commit 4bcd13b

Browse files
authored
feat: service bus message settlement support (#133)
* initial commit for message settlement support * base changes + client converter class * update method name * flake + unit tests * merge fix * test fixes * feedback * missed arg name * always secure * Revert "always secure" This reverts commit 04f4293. * secure fix * test fix * remove properties_to_modify * fix tests
1 parent 66889fa commit 4bcd13b

File tree

18 files changed

+1352
-4
lines changed

18 files changed

+1352
-4
lines changed

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
ignore = W503,E402,E731
77

88
exclude = .git, __pycache__, build, dist, .eggs, .github, .local, docs/,
9-
Samples, .env*, .vscode, venv*, *.venv*
9+
Samples, .env*, .vscode, venv*, *.venv*,
10+
azurefunctions-extensions-bindings-servicebus/azurefunctions/extensions/bindings/protos,
1011

1112
max-line-length = 88
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/empty.proto";
4+
import "google/protobuf/wrappers.proto";
5+
import "google/protobuf/timestamp.proto";
6+
7+
// this namespace will be shared between isolated worker and WebJobs extension so make it somewhat generic
8+
option csharp_namespace = "Microsoft.Azure.ServiceBus.Grpc";
9+
10+
// The settlement service definition.
11+
service Settlement {
12+
// Completes a message
13+
rpc Complete (CompleteRequest) returns (google.protobuf.Empty) {}
14+
15+
// Abandons a message
16+
rpc Abandon (AbandonRequest) returns (google.protobuf.Empty) {}
17+
18+
// Deadletters a message
19+
rpc Deadletter (DeadletterRequest) returns (google.protobuf.Empty) {}
20+
21+
// Defers a message
22+
rpc Defer (DeferRequest) returns (google.protobuf.Empty) {}
23+
24+
// Renew message lock
25+
rpc RenewMessageLock (RenewMessageLockRequest) returns (google.protobuf.Empty) {}
26+
27+
// Get session state
28+
rpc GetSessionState (GetSessionStateRequest) returns (GetSessionStateResponse) {}
29+
30+
// Set session state
31+
rpc SetSessionState (SetSessionStateRequest) returns (google.protobuf.Empty) {}
32+
33+
// Release session
34+
rpc ReleaseSession (ReleaseSessionRequest) returns (google.protobuf.Empty) {}
35+
36+
// Renew session lock
37+
rpc RenewSessionLock (RenewSessionLockRequest) returns (RenewSessionLockResponse) {}
38+
}
39+
40+
// The complete message request containing the locktoken.
41+
message CompleteRequest {
42+
string locktoken = 1;
43+
}
44+
45+
// The abandon message request containing the locktoken and properties to modify.
46+
message AbandonRequest {
47+
string locktoken = 1;
48+
bytes propertiesToModify = 2;
49+
}
50+
51+
// The deadletter message request containing the locktoken and properties to modify along with the reason/description.
52+
message DeadletterRequest {
53+
string locktoken = 1;
54+
bytes propertiesToModify = 2;
55+
google.protobuf.StringValue deadletterReason = 3;
56+
google.protobuf.StringValue deadletterErrorDescription = 4;
57+
}
58+
59+
// The defer message request containing the locktoken and properties to modify.
60+
message DeferRequest {
61+
string locktoken = 1;
62+
bytes propertiesToModify = 2;
63+
}
64+
65+
// The renew message lock request containing the locktoken.
66+
message RenewMessageLockRequest {
67+
string locktoken = 1;
68+
}
69+
70+
// The get message request.
71+
message GetSessionStateRequest {
72+
string sessionId = 1;
73+
}
74+
75+
// The set message request.
76+
message SetSessionStateRequest {
77+
string sessionId = 1;
78+
bytes sessionState = 2;
79+
}
80+
81+
// Get response containing the session state.
82+
message GetSessionStateResponse {
83+
bytes sessionState = 1;
84+
}
85+
86+
// Release session.
87+
message ReleaseSessionRequest {
88+
string sessionId = 1;
89+
}
90+
91+
// Renew session lock.
92+
message RenewSessionLockRequest {
93+
string sessionId = 1;
94+
}
95+
96+
// Renew session lock.
97+
message RenewSessionLockResponse {
98+
google.protobuf.Timestamp lockedUntil = 1;
99+
}

azurefunctions-extensions-bindings-servicebus/azurefunctions/extensions/bindings/protos/settlement_pb2.py

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)