Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add option to automatically set User-ID in basicPublish

オープン
#1,748 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@UmerQureshi21 がすでに取り組んでいます。

2026年1月19日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, rabbitmq

調査の方向性

Issue で参照されている ConnectionFactory、Connection、channel.basicPublish、AMQP.BasicProperties から調査を始めてください。設定されたユーザー名をどこに保持できるか、また現在の publish 処理が User ID をどのように扱っているかを確認してください。明示的な接続オプションまたはアクセス可能なユーザー名によって、アプリケーション層を介して渡すことなく publishing User-ID を設定でき、その関連する動作がテストでカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement
Is your feature request related to a problem? Please describe.

I am in the process of enabling Validated User-IDs to authorize RPCs.

Here is the example code from the documentation:

AMQP.BasicProperties properties = new AMQP.BasicProperties();
properties.setUserId("guest");
channel.basicPublish("amq.fanout", "", properties, "test".getBytes());

But right now getting the correct user id is kind of complicated. To gain access to the the username I would have to pass it down multiple layers of abstractions and dependency injection, as it is currently only available when creating the connection, not when using it.

Describe the solution you'd like

I would like to enable an option while creating the connection to always use my username as the user ID when publishing a message. Something like this:

connectionFactory.setUsername("bob")
  .setPassword("mypassword")
  .automaticallySetUserIdToUsername(true);

Alternatively this could be solved by making the username a public attribute of the Connection, so I could solve it like this:

AMQP.BasicProperties properties = new AMQP.BasicProperties();
properties.setUserId(channel.getConnection().getUsername());
channel.basicPublish("amq.fanout", "", properties, "test".getBytes());

This would require me to update a handful of code segments, but would be doable.

Describe alternatives you've considered

No response

Additional context

No response

主要言語
Java
スター
1.3k
フォーク
588
平均マージ
4時間 40分
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rabbitmq/rabbitmq-java-client のほかの issue

rabbitmq/rabbitmq-java-client の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。