Code Monkey home page Code Monkey logo

stampy's People

Contributors

burtonalexand14 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stampy's Issues

What are the Mina and Netty reference implementations?

I've opened a StackOverflow question here:
http://stackoverflow.com/questions/31627819/stampy-variations-on-stomp-protocol

I thought the STOMP protocol was standardised. So I don't understand the reference to Mina and Netty and why there isn't a "de-facto" client in the examples.

Can you please elaborate on whether this is a difference in the protocol? If I'm, say, connecting to a RabbitMQ STOMP server, does it matter which client RI I choose to use?

Is it possible to have an example which doesn't use Mina and Netty?

gateway.connect() undocumented Thread.sleep() required

When trying to implement the example code I find that

gateway.connect();

is needed , but I suspect this is not all, I have to Thread.sleep(...) for an unspecified amount of time before it is actually connected, I guess I need to respond to some callback?

Stampy is not "Java 5 compatible"

Issue
Although Stampy targets 1.5 in it's build, the 1.7 API is used by Stampy. For example AbstractStampyMessageGateway makes use of java.lang.invoke.MethodHandles which is new in Java 7. Though closer inspection it looks like any class which is logging is using java.lang.invoke.MethodHandles to reflect the class object. Thus when attempting to run a Stampy server on a JVM of lesser vintage that 1.7 you experience a NoClassDefFoundError exception which looks like the following on a 1.6 JVM:

java.lang.NoClassDefFoundError: java/lang/invoke/MethodHandles
    at asia.stampy.common.gateway.AbstractStampyMessageGateway.<clinit>(AbstractStampyMessageGateway.java:51)
    ...
Caused by: java.lang.ClassNotFoundException: java.lang.invoke.MethodHandles
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ...

Solution 1
Replace "Java 5 compatible" in the documentation with "Java 7 only" and stop targeting 1.5 for no reason.

Solution 2
Replace usages of the 1.7 API with 1.5 compatible equivalents. For example:

private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
// Should be replaced by
private static final Logger log = LoggerFactory.getLogger(AbstractStampyMessageGateway.class);

Example in the README does not compile

IDontNeedSecurity class does not exist.

If I try to create one similar I get

Exception in thread "main" asia.stampy.common.gateway.StampySecurityException: An instance of SecurityMinaMessageListener has not been configured first in the list of StampyMinaMessageListeners

I'm using the netty interfaces.

Also I can't see SUBSCRIBE and UNSUBSCRIBE messages??

Why HostPort and not URI?

I'm trying to build a RabbitMQ-Webstomp system behind Apache mod-wstunnel. This allows us to turn any websocket host:port combination (e.g. localhost:61613) to an apache URI https://server/myhiddenmq and therefore work with Stomp in situations where all but the most minimal ports are blocked.

However, Stampy appears only to use the HostPort class. This doesn't seem to accept a path, or protocol, or anything else.

Is there a technical requirement only to specify connections with Host:Port combinations?

Would it be a worthy fork for me to attempt to turn all the HostPort usage to URI?

gateway.connect() undocumented Thread.sleep

When trying to implement the example code I find that

gateway.connect();

is needed , but I suspect this is not all, I have to Thread.sleep(...) for an unspecified amount of time before it is actually connected, I guess I need to respond to some callback?

Message data is changed

When the message listener is fired stampy has removed all the '\n' characters from the message body.

Problem with Ivy

I am not an expert with Ivy but I had trouble with building a freshly checked out copy of the software.
In build.xml is the target

<target name="resolve">
    <ivy:resolve file="${basedir}/ivy.xml"/>
</target>

As I understand it, ivy:resolve downloads and resolves the deps into its cache directory. The task should be ivy:retrieve which resolves and then copies the files into the project's lib directory.

STOMP over websockets

Have you considered supporting STOMP over websockets, which most AMQP/STOMP brokers are starting to support? For Java apps integrating over the open internet, running stomp over websockets/wss on standard ports 80/443 is a nice solution that is ISP friendly...

Any builders?

To avoid boilerplate code in client/server configuration, something like:

AbstractStampyMessageGateway gw = new GatewayBuilder().
  withHost(3456).
  withHeartbeat(1000).
  add(listener1).
  add(listener2).
  build()

This pattern is also common for Netty internals.

Possible incorrect message ID being added to message list for acknolwedgement tracking

In AbstractAcknowledgementListenerAndInterceptor.java, interceptMessage, there is this line:

String ack = msg.getHeader().getAck();

That getAck() value is added to the queue as the identifier of the message, but shouldn't it be getId() instead? getAck returns auto, client or client-individual.

Here's the current implementation:

  public void interceptMessage(StampyMessage<?> message, HostPort hostPort) throws InterceptException {
    MessageMessage msg = (MessageMessage) message;

    String ack = msg.getHeader().getAck();

    Queue<String> queue = messages.get(hostPort);
    if (queue == null) {
      queue = new ConcurrentLinkedQueue<String>();
      messages.put(hostPort, queue);
    }

    queue.add(ack);
    startTimerTask(hostPort, ack);
  }

Now, when a method like evaluateAck uses the id header to look up the message in the queue, yet it will never find the message:

  private void evaluateAck(AckHeader header, HostPort hostPort) throws Exception {
    String id = header.getId();
    if (hasMessageAck(id, hostPort)) {
      clearMessageAck(id, hostPort);
      getHandler().ackReceived(id, header.getReceipt(), header.getTransaction());
    } else {
      throw new UnexpectedAcknowledgementException("No ACK message expected, yet received id " + id + " from "
          + hostPort);
    }
  }

  private boolean hasMessageAck(String messageId, HostPort hostPort) {
    Queue<String> ids = messages.get(hostPort);
    if (ids == null || ids.isEmpty()) return false;

    return ids.contains(messageId);
  }

Setting up Stampy server

Hi,
I have downloaded the zip and trying to setup the server.
but it requires a lot of external jars.
can you specify a list of the jars (preferably with download links) ?
can you provide a setup guide to run as java server application ?

Thanks
Your help much appreciated.
Ido H

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.