ActiveMQ + JBoss Fuse REST - rest

I'm trying to use JBoss Fuse activemq OSGi bundle. I'm able to produce and consume messages via standard JAVA JMS client, but I'm facing problem using REST API (HTTP)
for istance the curl method prosed by ActiveMQ documentation:
curl -u admin:admin -d "message" http://localhost:61616/api/message/myqueue?type=queue
fail with this message:
only whitespace content allowed before start tag and not m (position: START_DOCUMENT seen m... #1:1)
instead using SOAP UI with GET method to consume a message, the server logs this:
The clientID header specified is invalid. Client sesion has not yet been established for it: myClientID
Anyone has faced the same issue? Could someone explain what is not working?
Thanks

You are sending to port 61616 which is the default OpenWire port which will not work as a REST endpoint. You need to send them to the correct port which you need to check in your ActiveMQ broker configuration.

Related

Oracle Service Bus error: ClassCastException: CountingRequestWrapper cannot be cast to ServletRequestImpl

I developed a service for Oracle Service Bus and deployed on a WebLogic 12c server. The proxy service uses an HTTP adapter so that the service can be called using SOAP. The business service uses a REST adapter.
The service works fine when I test it on the integrated server or on my UAT server (which is WebLogic 12c) using the test page that's invoked from the ServiceBus console. Also tried using SOAPUI tool on two different Windows PC's.
However, when the third party invokes my service, I get an exception in my log. I added alerts and logs in my pipeline but neither of them get invoked meaning the exception happens in WebLogic before it can pass the request to my adapter.
Googling for "CountingRequestWrapper" gives zero results. I really can't figure out what is causing this.
Here's the log:
module:/MyApp/MyService path:null spec-version:3.1], request: weblogic.servlet.internal.ServletRequestImpl#35881271[
GET /MyApp/MyService?wsdl HTTP/1.1
Content-Type: text/xml;charset="utf-8"
Accept: /
Connection: Keep-Alive
]] Root cause of ServletException.
java.lang.ClassCastException: com.bea.wli.sb.transports.http.wls.CountingRequestWrapper cannot be cast to weblogic.servlet.internal.ServletRequestImpl
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:121)
at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
I did notice that at the top it says: path: null. Could it be something to do with that?
Request from log looks like a GET to wsdl address (GET /MyApp/MyService?wsdl) and you mentioned it's a soap proxy so that should most likely be a POST to service endpoint address. I would suggest to check 3rd party client side configuration first.

ActiveMQ Artemis Management Console with HTTPS

Is it possible to expose ActiveMQ Artemis (2.16.0) Management Console with HTTPS instead of plain HTTP?
Can't find any documentation on neither in Artemis docs or hawt.io to do that kind of setup.
Check out this documentation from the ActiveMQ Artemis User Manual.
You can simply set the bind attribute of the web element in bootstrap.xml to use https instead of http. Then, of course, you'll need to configure the other relevant settings like keyStorePath, keyStorePassword, etc.

HTTP error 403 when using Confluent Kafka REST Proxy

I use Confluent Kafka REST Proxy to send messages to Apache Kafka.
I set up basic authentication on the REST Proxy and whenever I submit a HTTP request to the proxy, I get the 403 HTTP Error !role.
The proxy requires Zookeeper, Kafka and Schema Registry to be running. I didn't configure any security on these services.
Without authentication, the proxy works and delivers messages to Kafka successfully.
How to I troubleshoot this problem? I spent multiple hours on that problem and I still can't fix it.
Check following:
Firewall allow the service or port
Is there any antivirus block the service or port
Rights given on kafka, confluent folder & respective log directory to kafka user.

Connect HttpResolver to API using custom port

Hello: I'm creating an Appsync endpoint to gradually upgrade all of our old Rest API to GraphQL. In our API we aggregate data from some third party services (also REST).
One of those services has an endpoint running in a custom port (let's say 8050) and while our initial idea was to use Appsync HTTP Resolvers to connect to it we've been experiencing timeout problems. Our provider says there is nothing wrong with it's service but I've searched Amazon Appsync docs and there's nothing there about ports.
Has anyone else experienced this issue and knows how to solve it?
Thanks in advance.
When configuring your HTTP Data source, you can append the port to the HTTP Endpoint URL. See below.
As of May 2021, I tried to specify the port number in HTTP Endpoint URL in the Data Source configuration UI, it didn't work. I still received the timeout error.
Since I have control to the HTTP API server, I changed the server to listen on port 80, removed port number from the datasource HTTP endpoint config, and things start to work. It seems as of now, appsync does not support listening on ports other than 80 for http.

Apache can't send request to localhost:8080 (to use Mule Esb Flow)

I'm trying to use a sample web application that use Ajax to send a request to a php REST service.
I need to use Mule ESB to do this, so i fix my ajax function to send request to ESB on localhost:8080. But the browser said that i can't do this for security reason.
So, there are any way to use mule ESB with a web app (local appache server) locally ?
Trying to GET a resource from the same host but from a different port is considered cross scripting as explained here
If you want to retrieve it you can:
all the option listed at the above link
put mule behind a reverse proxy within your apache configuration
serve all the content via mule