1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

トピックにパブリッシュするツールをつくる

Posted at

背景

CloudPub/Subのトピックに任意のメッセージを積む際に gcloud pubsub topics publish を用いれば容易に行えるが、 パターンが増えると面倒になるのと、今後使い回すことを考慮してメッセージパターンは修正しやすフォーマットで定義したかった。勉強がてらShellScriptでつくることにした。

概要

  • オプションで該当メッセージに対応するキーを渡す
  • --messageの値はJSONファイルから読む
  • gcloud pubsub topics publishを用いて該当トピックにパブリッシュする

gcloudのインストールや実行環境のセットアップなどは行なっておらず、トピック名をハードコーディングにしている点など、改善した方がいいところはたくさんあるが...こちらで最低限の機能を実装した。

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?