Git Product home page Git Product logo

aws-sqs-sample's Introduction

SQS Sample Scala

AWS SDK v2 を利用して簡単にSQSを試すサンプル

キューの名前

利用されるキューの名前は Constants に定義している

sample-queue

です。

AWSのクレデンシャル情報はローカルにセットされているデフォルトのものを利用します。 ※設定済み前提

それぞれの説明

  • CreateQueue: sample-queue という名前のQueueを作成する
  • DeleteQueue: sample-queue という名前のQueueを削除する
  • Publisher: 標準入力で受け取った文字列をQueueに投げる
  • Consumer: QueueからメッセージをConsumeし、出力する

CreateQueue

sample-queue という名前のqueueが作られます。

sbt "runMain CreateQueue"

DeleteQueue

sample-queue という名前のqueueを削除します。

sbt "runMain DeleteQueue"

Publisher

input> に適当な文字列を入力してください。 q と入力すると、Consumer も終了するメッセージを投げて、終了します。

sbt "runMain Publisher"
#... logback などの出力
publisher started. if you want finish this process, please input `q`
queue url: <queue url>
input>

Consumer

Publisher側で投げたメッセージを受け取って出力します。 Publisher側で q を入力すると、SQS経由で終了メッセージを受けて、タスクを終了します。

sbt "runMain Consumer"
# ... logback などの出力
consumer started
queue url: <queue url>
wait receive message...

aws-sqs-sample's People

Contributors

rinotc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.