A cabbit is a fictional hybrid between a cat and a rabbit.
The main goal of the library is to wrap rabbit-client with cats-effect & fs2.
The wrapper is intended to be thin and resemble the client.
amqp-client are the only dependencies.
cabbit is cross built for
scala "2.12.15" | "2.13.7" | "3.1.0" &
ce2 | ce3.
Thus, you can choose from these artifacts:
For ce3 versions add this instruction to your build.sbt:
libraryDependencies += "ru.delimobil" %% "cabbit" % "0.1.2"
For ce2 versions replace
To use circe encoders add this artifact to your build.sbt:
libraryDependencies += "ru.delimobil" %% "cabbit-circe" % "0.1.2"
This is how you can publish an arbitrary class to RabbitMQ:
import io.circe.generic.auto._ import ru.delimobil.cabbit.encoder.json.jsonUtf8 case class Message(from: String, msg: String) val node = CabbitNodeConfig(host, port) val config = CabbitConfig(NonEmptyList.one(node), "/") val exchange = ExchangeName.default val rk = RoutingKey("teaser-example-queue") val msg = Message("TeaserPublishApp", "hello from cabbit") ConnectionFactoryProvider .provide[IO](config, sslContext = None) .newConnection(config.addresses) .flatMap(_.createChannelPublisher) .use(_.basicPublish(exchange, rk, msg))
Ready to start? Follow the white cabbit.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.