Packages

  • package root
    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package leonard
    Definition Classes
    io
  • package amqp

    Scala wrapper for interacting with AMQP, the aim is for convenient: - scala style usage - RPC calls - event hooks - reconnection strategies - message creation and extraction for common message types

    Scala wrapper for interacting with AMQP, the aim is for convenient: - scala style usage - RPC calls - event hooks - reconnection strategies - message creation and extraction for common message types

    Overview

    Build connections with io.leonard.amqp.ConnectionHolder.builder

    Create a connection:

    val connection = ConnectionHolder.builder("amqps://guest:password@host:port")
      .eventHooks(EventHooks(eventListener))
      .reconnectionStrategy(ReconnectionStrategy.JavaClientFixedReconnectDelay(1 second))
      .build()

    Create a channel:

    val channel = connection.newChannel()

    Create an RPC server listening on queue "queue.name", expecting a String and echoing it back:

    def rpcHandler(request: Message): Future[Message] = request match {
      case Message.String(string) => Future(Message.String(string))
    }
    val queue = QueueDeclare(Some("queue.name"))
    val rpcServerCloser = channel.rpcServer(queue, AckOnHandled)(rpcHandler)

    Create an RPC client method which sends requests to the queue "queue.name" with a response timeout of 10 seconds :

    val rpcClient = RPCClient(channel)
    val rpcMethod = rpcClient.newMethod(Exchange.Default.route("queue.name"), 10 second)

    Create a consumer on "queue.name" printing out strings sent to it:

    def consumer(request: Message): Unit = request match {
      case Message.String(string) => println(string)
    }
    val queue = QueueDeclare(Some("queue.name"))
    channel.addConsumer(queue, consumer)

    Send a message to "queue.name":

    channel.send(Exchange.Default.route("queue.name"), Message.String("message")
    Definition Classes
    leonard
  • package concurrent
    Definition Classes
    amqp
  • package connection
    Definition Classes
    amqp
  • package properties
    Definition Classes
    amqp
  • BasicKey
  • BasicPropertiesReadable
  • Key
  • package rpc
    Definition Classes
    amqp
p

io.leonard.amqp

properties

package properties

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. properties
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class BasicKey[V] extends Key[V, V]
  2. class BasicPropertiesReadable extends BasicProperties

    This class is a canary to detect if any properties have been added to the java client's BasicProperties and not into MessageProperties

  3. sealed abstract class Key[J, V] extends AnyRef

Value Members

  1. object Key

    Keys for Message properties

Inherited from AnyRef

Inherited from Any

Ungrouped