GithubHelp home page GithubHelp logo

bulldog2011 / luxun Goto Github PK

View Code? Open in Web Editor NEW
160.0 160.0 40.0 5.5 MB

A high-throughput, persistent, distributed, publish-subscribe messaging system based on memory mapped file and Thrift RPC

Home Page: http://bulldog2011.github.io/luxun/

License: Apache License 2.0

Java 99.42% Thrift 0.58%

luxun's People

Contributors

bulldog2011 avatar youngwan657 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luxun's Issues

PruducerSendThread Die

  1. Async Producer server
    AsyncProducer.send(...) : throw QueueFullException occurred
    -> Still in the message transfer request
  2. Broker server die
  3. Producer server
    java.lang.RuntimeException: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection reset
  4. queue.addAll(events) execute
private void tryToHandle(List<QueueItem<T>> events) {
    if (logger.isDebugEnabled()) {
        logger.debug("handling " + events.size() + " events");
    }
    if (events.size() > 0) {
        try {
            this.eventHandler.handle(events, underlyingProducer, serializer);
        } catch (ConnectionRefusedException e) {
            List<QueueItem<T>> remainedItems = new ArrayList<QueueItem<T>>(events);
            while (queue.size() > 0) {
                remainedItems.add(queue.poll());
            }
            if (this.callbackHandler != null) {
                this.callbackHandler.connectionRefused(e.getMessage(), remainedItems);
            }
        } catch (RuntimeException e) {
            logger.error("Error in handling batch of " + events.size() + " events", e);
            queue.addAll(events);
        }
    }
}

Queue full & ProducerSendThread die.

java.lang.IllegalStateException: Queue full
        at java.util.AbstractQueue.add(AbstractQueue.java:98)
        at java.util.AbstractQueue.addAll(AbstractQueue.java:187)
        at com.leansoft.luxun.producer.async.ProducerSendThread.tryToHandle(ProducerSendThread.java:163)
        at com.leansoft.luxun.producer.async.ProducerSendThread.processEvents(ProducerSendThread.java:126)
        at com.leansoft.luxun.producer.async.ProducerSendThread.run(ProducerSendThread.java:63) 

solution

  1. IllegalStateException occurred
  2. tryToHandle(events) -> re execute
  3. Thrift connection attempt
  4. Connection attempt timeout.
  5. ConnectionRefusedException occurred
  6. CallbackHandler.connectionRefused(...) execute

Request 4 Feature: ACK

Is it possible to supply acknowledge option and to remove the message from the queue after consumer acknowledged?
In case of producer or consumer crash, during recovery, we might not expect the consumed messages.
Otherwise the consumer application might be designed as idempotent.

How do you think about it(or I have misunderstand Luxun's architecture )

IndexOutOfBoundsException while combining async producer and SimpleConsumer

Steps:

  1. 10K send by a producer with props.put("producer.type", "async");
  2. try to consume by index simpleConsumer1.consume("test-topic", index, 1024); in bounded while loop
  3. after the the first iteration, it failed with:
    Exception in thread "main" java.lang.IndexOutOfBoundsException
    at com.leansoft.luxun.common.exception.ErrorMapper.toException(ErrorMapper.java:34)
    at com.leansoft.luxun.consumer.SimpleConsumer.consume(SimpleConsumer.java:86)

Question about consumer failed message lost

Hi team,
I looked the design doc and saw consumer section, it will fetch messages in a blockingqueue first and up level consumer thread parallel consume. In case one up level consume one message failed, how we know it and let us consume again?

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.