Web Socket Server using Apache HttpComponent NIO - websocket

Is it possible to build a websocket server with apache httpcomponent nio server as the base?
https://hc.apache.org/httpcomponents-core-ga/httpcore-nio/examples/org/apache/http/examples/nio/NHttpServer.java
as mentioned in above link, I can build a nio server. But is it possible to convert it to a websocet server? If so any idea on how to do that please?

Thanks for the help guys. Finally I figured it out. I had to write a custom IOEventDispatch class and execute it through IOReactor.
Within my custom IOEventDispatch class websocket connecton handling is implemented.

Till what I have found is that, websocket is creating a tunnel from client to server(using javascript), while with nio socket you do this with total java(i.e. client can be applet but not js).
You can use websocket to transfer data fron client to server and use nio channel to write file on server.(Its feasible and look appropriate approach).

Related

About Non-blocking I/O is mean server side NIO?(in spring integration docs)

I'm working with spring integration.
In this link About Non-blocking I/O, is it talking about server side NIO?
I'm using TcpNioClientConnectionFactory(single-use = true) with CachingClientConnectionFactory. that document make me confused.
It applies to both the client and server sides.
Why the confusion? We read and write on both sides.
Without NIO, on the client side with single use, a new thread will be started and stopped for each request/reply; with NIO a pool of threads is used.

How to connect to remote weblogic JMS server?

I have a jms server running on weblogic and I need another application running on another server (weblogic as well) to listen to JMS topics sent by the JMS server mentioned before. The fact is that I don't know how to do that. I mean, what do I need on the consumer application side? Thansk in advance.
I know it´s a little old, but could help other people trying to achieve the same.
First you need to enable Cross-Domain Security on both domains envolved on your JMS communication. Please see specific documentation here: https://docs.oracle.com/middleware/1221/wls/SECMG/domain.htm#SECMG402
For reading a message from a JMS resource, there are a ton of examples you can search online, but basically you should rely on Weblogic´s t3 protocol. Here is a relativelly recent example using Spring Boot: Connect to remote jms queue with Spring Boot

Dynamic JMS Connections

I need to know which framework or API to use for my following requirement. I am currently using native java code for all this.
Requirement
I have an application where there could be multiple JMS/Rest/TCP connections. These connections can grow at runtime. User wil have a screen to define new incoming or outgoing connections. I am using Native and works fine but I want to make use of an efficient framework or API like Spring, Camel etc ?
Need Guidance.
I have been able to get this all working. There are multiple solutions to get do dynamic JMS
1. I used Spring JMS API and created the dynamic JMS connections by loading the dynamic child context into application. For this I followed the spring's dynamic FTP sample and inserted JMS beans in the example instead of FTP ones.
Spring Dynamic FTP Sample

Setting message size for spring sockjs websocket server

I have used spring sockjs server implementation for websockets. It supports messages upto 2kb but above that the websocket connection breaks -gives an 1006 error. If I reduce the message size, then it runs ok.
I went through the docs as well as classes, but could get a place where I can increase this limit. Have asked in spring forum as well but no reply.
Any Idea?
Any stack traces in the server logs? What server? And what transport is being used (websocket, xhr-streaming, other?) For the WebSocket transport you may be hitting default limits on the message buffer. Have you seen the section on Configuring the WebSocket Engine in the documentation?
Got it resolved, the way spring document has mentioned, did not worked for me -tomcat would not pick the parameters from there. Finally getting hold of ServletServerContainerFactoryBean (which is always singleton) and setting the properties there worked for me. Details:
How to increase output buffer for spring sockjs websocket server implementation.

HTTP web sockets Vs ActiveMQ web sockets

http://activemq.apache.org/websockets.html says that these guys have implemented stomp over web sockets functionality. How is it different for the normal web sockets solution provided by Dojo's cometd? I thought web socket spec defines its own message structure and all? How does the HTTP upgraded web socket differs from this stomp over websockets? Would really appreciate some expert opinion guys.
Thanks,
Bhanu
The cometd implementation uses the Bayeux protocol, while the Apache implementation uses WebSockets.

Resources