Latest 0.9.0
Homepage https://github.com/rabbitmq/rabbitmq-objc-client
License Mozilla Public License, Version 1.1 and Apache License, Version 2.0
Platforms ios 8.0
Dependencies JKVValue, CocoaAsyncSocket
Authors

RabbitMQ Objective-C and Swift client

Build Status

A RabbitMQ client, largely influenced by Bunny.

Test-driven from Swift and implemented in Objective-C, to avoid burdening Objective-C developers with Swift baggage.

Currently implemented

Installation with Carthage

  1. Create a Cartfile with the following line:

    github "rabbitmq/rabbitmq-objc-client" ~> 0.9

    Run carthage, for example in a new project:

    carthage bootstrap --platform iOS
  2. In your Xcode project, in the Build Phases section of your target, open up Link
    Binary With Libraries
    . Now drag Carthage/Build/iOS/RMQClient.framework into
    this list.
  3. If you don’t already have one, click the ‘+’ icon under Build Phases to add a
    Copy Files phase.
  4. Under Destination, choose Frameworks.
  5. 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.9'

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

Documentation

(Basic) Usage Example

  1. Instantiate an RMQConnection:

    let delegate = RMQConnectionDelegateLogger() // implement RMQConnectionDelegate yourself to react to errors
    let conn = RMQConnection(uri: "amqp://guest:[email protected]: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: (m.body)")
    }
    q.publish("foo".dataUsingEncoding(NSUTF8StringEncoding)!)
  5. Close the connection when done:

    conn.close()

See the tutorials for more detailed instructions.

Running Tests

First make sure you have xctool installed:

brew install xctool

Then start a local RabbitMQ node (any way you please, doesn’t have to be from Homebrew or source),
configure it using files under .travis/etc/, for example:

brew install rabbitmq
cp .travis/etc/* /usr/local/etc/rabbitmq/
/usr/local/sbin/rabbitmq-plugins enable --offline rabbitmq_auth_mechanism_ssl
brew services start rabbitmq

Then run a few setup steps:

bin/bootstrap-if-needed
/usr/local/sbin/rabbitmqctl add_user "O=client,CN=guest" bunnies
/usr/local/sbin/rabbitmqctl -p / set_permissions "O=client,CN=guest" ".*" ".*" ".*"

Finally, run the test suite:

xctool -project RMQClient.xcodeproj -sdk iphonesimulator -scheme RMQClient test

License

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

Latest podspec

{
    "name": "RMQClient",
    "version": "0.9.0",
    "summary": "RabbitMQ client",
    "description": "RabbitMQ client for iOS Objective-C and Swift. Developed and supported by thenRabbitMQ team.",
    "homepage": "https://github.com/rabbitmq/rabbitmq-objc-client",
    "license": "Mozilla Public License, Version 1.1 and Apache License, Version 2.0",
    "authors": {
        "RabbitMQ team": "[email protected]"
    },
    "social_media_url": "https://twitter.com/rabbitmq",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/rabbitmq/rabbitmq-objc-client.git",
        "tag": "v0.9.0"
    },
    "source_files": [
        "RMQClient",
        "RMQClient/**/*.{h,m}"
    ],
    "dependencies": {
        "JKVValue": [],
        "CocoaAsyncSocket": [
            "~> 7.4"
        ]
    }
}

Pin It on Pinterest

Share This