Details

    • Type: Task
    • Status: Resolved
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Event Stream
    • Labels:

      Description

      Dear fellows,
      I want to use /v2/event get all things real time, because the subscribe things could not get for sure sometimes。
      I used org.glassfish.jersey.media.sse to get things, but I got errrors below:

      InboundJaxrsResponse{context=ClientResponse{method=GET, uri=http://marathon-ip:port/v2/events, status=405, reason=Method Not Allowed}}
      javax.ws.rs.NotAllowedException: HTTP 405 Method Not Allowed
      at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1011)
      at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:816)
      at org.glassfish.jersey.client.JerseyInvocation.access$700(JerseyInvocation.java:92)
      at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:700)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
      at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:696)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:420)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:316)
      at my.springboot.SseClient.consumeEventStream(SseClient.java:36)
      at my.springboot.SseClient.main(SseClient.java:101)
      here is the code:

      Client client = ClientBuilder.newBuilder().register(new SseFeature()).build();
      WebTarget target = client.target(url);
      Response clientResponse = target.request().get();
      System.out.println(clientResponse);
      EventInput e = null;
      while (true) {
      if (e == null || e.isClosed())

      { e = target.request().get(EventInput.class); e.setChunkType("text/event-stream"); }

      final InboundEvent inboundEvent = e.read();
      if (inboundEvent == null)

      { break; }

      else

      { String data = inboundEvent.readData(); // do something here - notify observers, parse json etc System.out.println(data); }

      }
      System.out.println("connection closed");

      what should I do?
      help

      This isssue has been created automatically from Marathon GitHub Issue 5669.

        Attachments

          Activity

            People

            • Assignee:
              icharalampidis Ioannis Charalampidis
              Reporter:
              marathon-bot Marathon Bot
              Team:
              Orchestration Team
              Watchers:
              Ioannis Charalampidis, Marathon Bot, Matthias Eichstedt
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: