socket.io and asyncapi integration - socket.io

trying to build a socket.io server implementation using the socket.io java library and trying to figure out if there is any integration with AsyncAPI for the documentation, code generation etc.

Related

Corda: Alternative to Spring application for performing the RPC connection to the Corda node

We are working on a POC that uses Corda 4.0, Spring 4.3.11 and Springboot 2.0.2.
AngularJs is used for Front-end and PostgreSQL for database.
Is there an alternative to Spring application that would facilitate the RPC connection to the Corda node?
Yes, you can use Braid Server with Open API generator to generate client API's in more than 40 languages; read about it here.
There's a Braid server example (with a React font-end) here.

Start an embedded gRPC server while running integration tests with Springboot

I have built a Springboot application which has a gRPC server as one of its dependencies. While running the integration test, I am able to use embedded Kafka, embedd MySQL etc using TestContainers, but how can I create an embedded gRPC server while running my integration test suite?
I have the .proto contract definition file. I would use Wiremock to mock the request and responses to the gRPC server, but I am unable to start the embedded gRPC server yet.
It will be really great if I could find some help here.
Come to think of it, my question can be generalized to starting a generic embedded HTTP server in Springboot integration test, using TestContainers or otherwise.
I had a similar problem with IT testing Java gRPC service integrations, as using InProcessServer is quite cumbersome and quite hard to use when you need to return different responses for different tests. Also when using it you cannot really test your Stub beans and their configuration, since you can't pass InProcessServer host as a variable.
For this purpose I've created a gRPC Java mocking tool gRPC Mock. It has two integration modules - one for spring-boot and one for JUnit5. It follows a similar DSL type of structure to HTTP mocking service WireMock for creating the stubs. You can visit the GitHub page for some examples.

How enable Angular Universal with a Java/Spring backend?

I have an app, where backend implements on Spring using Spring Boot and front-end side use Angular2. Can somebody help me and explain how to integrate Universal using Java becken. Or show me a good example how I can do that.
how to integrate Universal using Java beckend?
You cannot do that directly as universal needs a different server side technology -nodejs
But you have a another (better) solution
Spin off a separate nodejs app for the angular and universal then route all the API calls through the nodeJs to your Spring boot application. Now your spring boot application will be just a (micro)service which will only deal with the data, not the presentation (markup/style etc)

Websocket support in a web application

I want to develop a web application using websocket.
I have found two solutions for this task:
Using Spring websocket (included in Spring 4) - I am already familiarized with Spring
Using Atmosphere framework - I've read the docs, it seems to be a mature framework.
I want from the websocket framework to provide a fallback-support in case when the
browser isn't HTML5 compliant, also, I need a client-library for android.
I see that Atmosphere provides support for Socket.IO library, which I want to use on
browser client side. I see that Spring websocket provides only SockJS support over STOMP.
Can I use the same library, Socket.IO, in Spring websocket?
Do you recommend me to use Atmosphere + Spring (for building the RESTFul API) in the same
project?
Thank you
I would suggest going for the WebSocket support in Spring. If you are already using Spring, this will give you a similar programming model plus all these features:
Fallback options with SockJS
Subprotocol support with STOMP
Integration with full blown STOMP broker (like RabbitMQ)
HttpSession and WebSocket Session sync (using Spring Session)
WebSocket security (in the upcoming Spring Security 4)
SockJS Java client (for application to application communication and performance testing, haven't tried it on Android yet but might work)
Runtime Monitoring
Active community with fast response times to requests
The WebSocket support has been around since Spring 4, tested and refined for over a year now. A production ready solution which I'm using in my projects.

Websocket as a platform-independent protocol?

I'm newbie in web application development and protocols.
I'm developing a Java-EE web application that uses the Websocket java API, but the client is a C++ application with its own API written in C++.
I want to exchange the data by using JSON, do I need to implement my own API in C++ Language to be used by the client or can I just send the data from java and receive it by C++ so that each one can use its own API?

Resources