[ 
https://issues.apache.org/jira/browse/AMQ-5579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14389818#comment-14389818
 ] 

J G commented on AMQ-5579:
--------------------------

Hi All,

I am new around here, so sorry if I get the etiquette wrong...

I am working on a project to use Apache ActiveMQ with a RESTful interface.  
It's a cross platform error logging project, so code written in C++, Java, VBA, 
Perl or indeed anything that can access an URL can then report issues. The 
point is, we DO NOT deploy any libraries - we simply use the native 
implementations within the language to access an URL.  The HTTP message body 
then contains the details of the error - who, what, when, what line of code and 
so on.

The piece I am working on is a port of an MSMQ implementation (you can a 
simpllified implementation of the MSMQ version on this 
http://blog.alignment-systems.com/2015/03/excel-vba-industrialisationpart-seven.html
 and on github at https://github.com/JohnGreenan/7_ExcelVBE)

So, I can access Apache Active MQ from a Windows PC using the 
WinHttp.WinHttpRequest class 
(https://msdn.microsoft.com/en-us/library/windows/desktop/aa384106%28v=vs.85%29.aspx)

The issue is that when I try and send a body of the request, I get the same 
error as shown in this JIRA.

Within cURL it's possible to workaround as described by Mark Frazier, but I 
have tried a few approaches on this WITHIN VBA and failed to get it to work.

What I propose to do is to create a github repository with the VBA code and 
instructions on how to replicate, but I am not sure if that's how you guys 
work? Do you actually work with implementations in languages, or is it just the 
case that it it works with cURL then the other language implementation is 
viewed as being at fault?

Can you please give me some guidance on how I can work with you to get this 
resolved?

Cheers,

John

> REST production of message bodies can result in IllegalStateException: 
> STREAMED
> -------------------------------------------------------------------------------
>
>                 Key: AMQ-5579
>                 URL: https://issues.apache.org/jira/browse/AMQ-5579
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: AMQ 5.11.0, mac
>            Reporter: Arthur Naseef
>            Assignee: Arthur Naseef
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Attempting to post a message to AMQ using the following yields an 
> IllegalStateException:
> *Example Command*
> {code}
> curl -u admin:admin -d "hello world" -XPOST 
> http://localhost:8161/api/message?destination=queue://abc.def
> {code}
> *Exception*
> {code}
> java.lang.IllegalStateException: STREAMED
>       at org.eclipse.jetty.server.Request.getReader(Request.java:898)
>       at 
> org.apache.activemq.web.MessageServletSupport.getPostedMessageBody(MessageServletSupport.java:347)
>       at 
> org.apache.activemq.web.MessageServlet.doPost(MessageServlet.java:126)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
>       at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
>       at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
>       at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
>       at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:522)
>       at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>       at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
>       at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
>       at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>       at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
>       at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>       at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
>       at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:522)
>       at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
>       at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>       at org.eclipse.jetty.server.Server.handle(Server.java:370)
>       at 
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
>       at 
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
>       at 
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
>       at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
>       at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
>       at 
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>       at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
>       at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>       at java.lang.Thread.run(Thread.java:745)
> {code}
> Note that changing the {{-d}} syntax to {{-d "body=hello world"}}, the 
> problem goes away.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to