Skip to content

Expose Key and TenantId properties in PublishMessageResponse and BroadcastSignalResponse#834

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-key-and-tenantid-properties
Draft

Expose Key and TenantId properties in PublishMessageResponse and BroadcastSignalResponse#834
Copilot wants to merge 2 commits into
mainfrom
copilot/add-key-and-tenantid-properties

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 6, 2025

closes #

Description

The IPublishMessageResponse and IBroadcastSignalResponse interfaces were empty despite the gateway protocol defining Key and TenantId fields. The proto-generated response classes contained these properties, but command implementations discarded the gRPC responses.

Changes

API Interfaces

  • Added Key (long) and TenantId (string) properties to IPublishMessageResponse
  • Added Key (long) and TenantId (string) properties to IBroadcastSignalResponse

Implementation Classes

  • Updated PublishMessageResponse to accept proto response and expose properties
  • Updated BroadcastSignalResponse to accept proto response and expose properties

Command Classes

  • Fixed PublishMessageCommand.Send() to capture and pass response instead of discarding with _
  • Fixed BroadcastSignalCommand.Send() to capture and pass response instead of discarding with _

Tests

  • Updated GatewayTestService to return responses with Key and TenantId values
  • Added tests verifying properties are correctly exposed

Usage

var response = await client
    .NewPublishMessageCommand()
    .MessageName("order-placed")
    .CorrelationKey("order-123")
    .AddTenantId("acme-corp")
    .Send();

Console.WriteLine($"Published message with key: {response.Key}");
Console.WriteLine($"Tenant ID: {response.TenantId}");
Original prompt

This section details on the original issue you should resolve

<issue_title>PublishMessageResponse and BroadcastSignalResponse missing Key and TenantId properties</issue_title>
<issue_description>## Description

The IPublishMessageResponse and IBroadcastSignalResponse interfaces are empty and do not expose the Key and TenantId properties that are defined in the gateway protocol and returned by the Zeebe Gateway gRPC service.

Expected Behavior

According to the gateway.proto definition, both responses should expose:

message PublishMessageResponse {
  // the unique ID of the message that was published
  int64 key = 1;
  // the tenant id of the message
  string tenantId = 2;
}

message BroadcastSignalResponse {
  // the unique ID of the signal that was broadcasted.
  int64 key = 1;
  // the tenant id of the signal that was broadcasted.
  string tenantId = 2;
}

Actual Behavior

The C# client defines empty interfaces:

Client/Api/Responses/IPublishMessageResponse.cs:

public interface IPublishMessageResponse
{
    // Empty!
}

Client/Api/Responses/IBroadcastSignalResponse.cs:

public interface IBroadcastSignalResponse
{
    // Empty!
}

Root Cause

The proto-generated classes DO have the properties (in Client/Impl/proto/Gateway.cs), but the command implementations discard the response:

Client/Impl/Commands/PublishMessageCommand.cs (line 72-73):

var asyncReply = client.PublishMessageAsync(request, ...);
_ = await asyncReply.ResponseAsync;  // ❌ Response discarded
return new PublishMessageResponse(); // ❌ Returns empty wrapper

Client/Impl/Commands/BroadcastSignalCommand.cs (line 49-50):

var asyncReply = client.BroadcastSignalAsync(request, ...);
_ = await asyncReply.ResponseAsync;  // ❌ Response discarded
return new BroadcastSignalResponse(); // ❌ Returns empty wrapper
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

… responses

Co-authored-by: ChrisKujawa <2758593+ChrisKujawa@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Key and TenantId properties to responses Expose Key and TenantId properties in PublishMessageResponse and BroadcastSignalResponse Dec 6, 2025
Copilot AI requested a review from ChrisKujawa December 6, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PublishMessageResponse and BroadcastSignalResponse missing Key and TenantId properties

3 participants