1) android (client):

Getting Started with RabbitMQ on Android – Part 1介绍了如何在android上使用rabbitmq接收server端的push通知。

2) server :

server端安装rabbitmq,写了个python脚本来发送消息,例子代码:

#!/usr/bin/env python
import pika
import time

connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()


channel.queue_declare(queue='hello')

i = 0
while True:
channel.basic_publish(exchange='logs',
routing_key='hello',
body='Hello World, ' + str(i))
print " [x] Sent 'Hello World!'" + str(i)
i += 1
time.sleep(1)
connection.close()

关于用python如何用rabbitmq发消息,参见:RabbitMQ introduction

代码见:rabbitmq(RabbitMQ - messaging that just works)

更多相关文章

  1. Android 日志系统logcat内核代码分析
  2. 编写android jni代码时遇到的问题
  3. Android 代码自动提示功能
  4. android两种方式实现发送短信的功能代码
  5. Android 进阶——Android Studio 项目结构详细述及Gradle脚本语
  6. 原始Android的目标机代码结构
  7. 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)
  8. Android自动化测试之MonkeyRunner录制和回放脚本(十一)
  9. 第一行代码笔记1

随机推荐

  1. Android(安卓)camera: Metadata\Image从
  2. android 图片手势放大缩小
  3. adb 命令集及常用命令
  4. Android(安卓)ListView 滑到最后一条自动
  5. 自定义dialog并设置margin
  6. android接入高德路线规划之驾车模式
  7. AlarmManager定时重复任务,发送心跳
  8. 自定义app锁屏页
  9. No original dex files found for dex lo
  10. android双指平移、旋转、缩放控件完美版