Code Monkey home page Code Monkey logo

rmqclient's Introduction

RabbitMQ Objective-C and Swift client

Build Status

A RabbitMQ client, largely influenced by Bunny.

Test-driven from Swift and implemented in Objective-C.

Supported iOS and macOS Versions

This library currently targets iOS 11+ and macOS 10.12+.

Dependencies

This library depends on

Installation with Carthage

  1. Create a Cartfile with the following line:
github "rabbitmq/rabbitmq-objc-client" "v0.11.0"

Run Carthage, for example in a new project:

carthage bootstrap
  1. In your Xcode project, in the Build Phases section of your target, open up Link Binary With Libraries. Now drag e.g. Carthage/Build/iOS/RMQClient.framework (choose Mac for OSX) into this list.
  2. If you don't already have one, click the '+' icon under Build Phases to add a Copy Files phase.
  3. Under Destination, choose Frameworks.
  4. Click the '+' and add RMQClient.framework. Ensure Code Sign On Copy is checked.

Installation with CocoaPods

  1. Add the following to your Podfile:

    pod 'RMQClient', '~> 0.11.0'
    

    We recommend adding use_frameworks! to enable modular imports (Objective-C only).

  2. Run pod install.

  3. Open your project with open MyProject.xcworkspace.

Objective-C users: importing with @import RMQClient; currently produces an error in Xcode (Could not build module 'RMQClient'), but this should not prevent code from compiling and running. Using crocodile imports avoids this Xcode bug: #import <RMQClient/RMQClient.h>.

Supported Features

Documentation

(Basic) Usage Example

  1. Instantiate an RMQConnection:

    let delegate = RMQConnectionDelegateLogger() // implement RMQConnectionDelegate yourself to react to errors
    let conn = RMQConnection(uri: "amqp://guest:guest@localhost:5672", delegate: delegate)
  2. Connect:

    conn.start()
  3. Create a channel:

    let ch = conn.createChannel()
  4. Use the channel:

    let q = ch.queue("myqueue")
    q.subscribe({ m in
       print("Received: \(String(data: m.body, encoding: String.Encoding.utf8))")
    })
    q.publish("foo".data(using: String.Encoding.utf8))
  5. Close the connection when done:

    conn.close()
    

See the tutorials for more detailed instructions.

Running Tests

See CONTRIBUTING.md.

License and Copyright

(c) 2016-2022 VMware, Inc. or its affiliates

This package, the RabbitMQ Objective-C client library, is dual-licensed under the Mozilla Public License 2.0 ("MPL") and the Apache License version 2 ("ASL").

rmqclient's People

Contributors

richsal 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.