Code Monkey home page Code Monkey logo

external-mq-fabric-client's People

Contributors

chirino avatar christian-posta avatar dejanb avatar kevinearls avatar scranton avatar

Stargazers

 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

external-mq-fabric-client's Issues

It's working on Fuse 6.3...

I tested on a Fuse 6.3 installation ant it worked fine.
Why README says it's not supported on 6.3 and later?

Needs updating for Fuse Fabric 7.1 GA

We have added admin=admin,admin to both $FABRIC/etc/users.properties and $FABRIC/instances/<child-container-name>/etc/users.properties, then modified the relevant lines of this project's code to read as below:

Context context = new InitialContext();
ConnectionFactory factory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY_NAME);
Destination destination = (Destination) context.lookup(DESTINATION_NAME);
connection = factory.createConnection("admin","admin");
connection.start();

This fails unfortunately. Here's what mvn -e -Pproducer-default prints out when run on the fabric host:

INFO exec:java {execution: default}
10:47:59 INFO ******************************
10:47:59 INFO Connecting to Fuse MQ Broker using URL: discovery:(fabric:default)
10:47:59 INFO ******************************
10:48:00 INFO Using local ZKClient
10:48:00 INFO Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
10:48:00 INFO Client environment:host.name=ithffu01.ocado.com
10:48:00 INFO Client environment:java.version=1.6.0_26
10:48:00 INFO Client environment:java.vendor=Sun Microsystems Inc.
10:48:00 INFO Client environment:java.home=/usr/lib/jvm/java-6-sun-1.6.0.26/jre
10:48:00 INFO Client environment:java.class.path=/usr/share/maven2/boot/classworlds.jar
10:48:00 INFO Client environment:java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
10:48:00 INFO Client environment:java.io.tmpdir=/tmp
10:48:00 INFO Client environment:java.compiler=<NA>
10:48:00 INFO Client environment:os.name=Linux
10:48:00 INFO Client environment:os.arch=amd64
10:48:00 INFO Client environment:os.version=2.6.32-5-amd64
10:48:00 INFO Client environment:user.name=root
10:48:00 INFO Client environment:user.home=/root
10:48:00 INFO Client environment:user.dir=/var/tmp/external-mq-fabric-client-master
10:48:00 INFO Initiating client connection, connectString=localhost:2181 sessionTimeout=10000 watcher=org.linkedin.zookeeper.client.ZKClient@5a81b83c
10:48:00 INFO Opening socket connection to server /127.0.0.1:2181
10:48:00 WARN SecurityException: java.lang.SecurityException: Unable to locate a login configuration occurred when trying to find JAAS configuration.
10:48:00 INFO Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
10:48:00 INFO Socket connection established to localhost/127.0.0.1:2181, initiating session
10:48:00 INFO Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13c48782a180015, negotiated timeout = 10000
10:48:00 INFO Starting StateChangeDispatcher
10:48:00 INFO EventThread shut down
10:48:00 INFO Session: 0x13c48782a180015 closed
10:48:00 ERROR javax.jms.JMSException: Could not connect to broker URL: discovery:(fabric:default). Reason: org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /fabric/registry/clusters/fusemq/default

Any suggestions what we're missing?

Change consumer to support broker failure + other improvements

We've customised this project quite a bit. We now combine it with Ruby and Cucumber, these communicate with Fabric to simulate broker failure by starting and stopping containers containing brokers in the same group. Our customised version of this artifact is downloaded within the Cucumber demo feature and parameterised with CLI system properties specifying the message count, message delay and whether a producer or consumer should be spawned.

There are a few improvements we'd like to suggest to this reference example, listed here as comments on our own modified version:

  1. Up to the point of session creation the code for both producer and consumer is common. This code is pushed into a common parent class.
  2. Many identical properties are defined in the pom for the different profiles you've defined. Those common ones (such as broker.username, broker.password, zookeeper.url) can be pushed into the <properties> section to avoid this duplication.
  3. Your SimpleConsumer breaks the message consumption loop if the message is null. This isn't supportive of simulating broker failure, since occasionally a null is received when the broker fails before the client receives an EOFException. In our version we continue until an expected number of messages is consumed.

Regarding (3) - we realise our modification is flawed in that the consumer will run indefinitely if the producer hasn't sent the expected number of messages.

We'd like to know how best to modify the consumer to support a null message from broker failure and recognise when the broker's running but there are no more messages to consume.

Must you define advisory messages to be certain of this latter situation?

Could you please update your example to correctly support both broker failure and termination upon no more messages? We'd love to learn of the correct approach to handle both scenarios.

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.