Giter Site home page Giter Site logo

mq-http-java-sdk's Introduction

MQ JAVA HTTP SDK

Alyun MQ Documents: http://www.aliyun.com/product/ons

Aliyun MQ Console: https://ons.console.aliyun.com

Use

Add Maven Dependency

<dependency>
    <groupId>com.aliyun.mq</groupId>
    <artifactId>mq-http-sdk</artifactId>
    <version>1.0.3.2</version>
</dependency>

Or With-dependencies

<dependency>
    <groupId>com.aliyun.mq</groupId>
    <artifactId>mq-http-sdk</artifactId>
    <version>1.0.3.2</version>
    <classifier>jar-with-dependencies</classifier>
</dependency>

Note

  1. Http consumer only support timer msg (less than 3 days), no matter the msg is produced from http or tcp protocol.
  2. Order is only supported at special server cluster.

Sample (github)

Publish Message

Consume Message

Transaction Message

Publish Order Message

Consume Order Message

Sample (code.aliyun.com)

Publish Message

Consume Message

Transaction Message

Publish Order Message

Consume Order Message

mq-http-java-sdk's People

Contributors

drpmma avatar xdkxlk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mq-http-java-sdk's Issues

Message's property can't be null or empty, [RequestId]: null

[Error Code]:Unknown, [Message]:Message's property can't be null or empty, [RequestId]: null
at com.aliyun.mq.http.model.action.PublishMessageAction.buildRequest(PublishMessageAction.java:44)
at com.aliyun.mq.http.model.action.PublishMessageAction.buildRequest(PublishMessageAction.java:20)
at com.aliyun.mq.http.model.action.AbstractAction.buildRequestMessage(AbstractAction.java:238)
at com.aliyun.mq.http.model.action.AbstractAction.executeWithCustomHeaders(AbstractAction.java:103)
at com.aliyun.mq.http.model.action.AbstractAction.executeWithCustomHeaders(AbstractAction.java:124)
at com.aliyun.mq.http.MQProducer.publishMessage(MQProducer.java:105)
at me.java.library.mq.ons.http.OnsHttpProducer.onSend(OnsHttpProducer.java:73)

消费消息时,队列如果没有消息则会抛异常

版本1.0.1
在Java代码中调用
messages = consumer.consumeMessage(10, 5);
如果队列中没有消息会抛ServiceException, errorCode = "internalServerError"
detailMessage里面的信息是:

<?xml version="1.0" ?>
<Error xmlns="http://mq.aliyuncs.com/doc/v1">
  <Code>MessageNotExist</Code>
  <Message>Message not exist.</Message>
  <RequestId>5DF07C9B31383790319F4D26</RequestId>
  <HostId>http://1480897041841542.mqrest.cn-beijing.aliyuncs.com</HostId>
</Error>

我不太能理解为什么会抛异常,没有消息直接返回空不就好了

如何订阅多个messageTag?

如tcp订阅,通过“||”来订阅多个tag,请问http是如何实现的?
http的订阅貌似只能是equal,并不能通过“||”来订阅多个tag。
If not empty, only consume the message which's @see {@link TopicMessage#messageTag} is equal to it

因此为了实现订阅多个tag的目的,每个应用都需要订阅所有的tag,然后再把所有的tag获取后,排除不是自己应用的tag,然后再进行处理。

[Bug]目前没有主动报消费失败的接口

目前只能全部成功,消息如果消费失败也只能上传消费成功,没有主动上报消费失败的功能,现在消息消费失败我还得主动记录然后手动然后自行处理,根本没办法把RocketMq的消息异常的功能用起来

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.