Apache AVRO with Spring boot - spring-boot

Does anyone know hot to use Apache AVRO RPC with Spring boot? Every single AVRO implementation I have seen is hosted on a netty server.

You might be trying to achieve the same thing I'm trying to achieve -- speeding up json serialization with spring boot and spring web. Or maybe you just want to use avro? And my comment is a little late, since it's months after you posted. I have run across this information about using an avro message converter, so thought I would share it with you to see if it helps:
https://docs.spring.io/spring-cloud-stream/docs/Brooklyn.RELEASE/reference/html/contenttypemanagement.html#_schema_based_message_converters
Or did you already find it? If so, can you share whatever solution that you came up with? Our rest json serialization takes much longer than the whole rest of the operation and I would like to speed it up as much as possible.

Related

Are there any good alternatives to Apache Ignite as an In-Memory Data Grid used together with Spring as a distributed cache?

We have a solution which uses the Apache Ignite-provided In-Memory Data Grid as a distributed cache. For newer projects, we ended up using Spring, and as such we wished homogenize our software ecosystem and using Spring for the first solution as well. In addition, we do not use all the features of Ignite to excuse its use (discovery, caching).
Since we currently only use a limited subset of features from Ignite, we are basically looking for a self-managed application-level distributed cache solution (similar to what Ignite provides). This means that dedicated caching infrastructure like Redis, Memcached, etc. is not what we want.
I've researched the topic somewhat and found that there are some possible alternatives like:
Tayzgrid - Last update seems to be quite some time ago, not sure if still actively maintained
Druid - Still incubating, and I have also read that new releases being somewhat broken was not that uncommon
Hazelcast - Seems like the best choice given its maturity and the existence of Spring Data Hazelcast, though I am unsure what the level of support is here.
Has anyone has experience with integrating one of the above IMDGs (aside from Ignite) with Spring Cache? Any pointers in the right direction would be greatly appreciated.
You can use Redisson - Redis Java client with features of
In-Memory Data Grid. It also implements Spring Data support. Here is the documentation.
Hazelcast has official support for Spring Data Hazelcast and also this module has many users as now. I can also suggest you to have a look at the resources below:
Using Hazelcast with Spring Data
Getting Started with Microservices Using Hazelcast IMDG and Spring Boot

Trying to speed up spring-web endpoint json serialization (afterburner)

I am using Spring Boot 1.5.8 and spring-web 4.3.12. I have noticed that, when I make a request for data from one of our REST endpoints, more time is spent on data serialization than the rest of the operation. I have been looking into strategies to speed things up, and I learned about the Jackson Afterburner module. The spring documentation claims that I only need to create a #Bean in a #Configuration class and the ObjectMapper that is created will have that module registered. Unfortunately, after adding the Spring bean, the serialization performance remains unchanged. What am I doing wrong?
Also, if anyone has any other ideas about how to increase the json serialization performance in a Spring REST controller, I would be very interested in hearing about them.
Thanks in advance.
I have tried the Afterburner module, and I did not notice much (or really any) improvement in performance. Maybe Spring is already using it, or other, optimizations. After looking around a bit, I learned about Kryo, and that seems to help.
If nobody else posts a suggestion, I will have to accept my own answer, but I will wait for a bit.

Spring boot , Elasticsearch

Searched over the net but unable to find the satisfying approach.
I am new to spring boot and aware of starter dependancies,
I want to develop a springboot app using elastic search as a storage system.
Wherever i searched i found that somewhere my service class will have to implement some interface from springframework for ES crud operations.
Is there any other way without implementing or extending the components.
I myself want to create transport client and want to query ES by my code or methods not by overidden ones.
Please if you ahve ever seen any projects you can redirect me to that link .
Thanks.
Assuming I understand you correctly, you can use the Elasticsearch REST client: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html
You supply the JSON entities for the queries and parse the responses yourself. Its pretty basic in what it does, so you're not dependent on a lot of third party stuff to perform operations.

Reading from xml file and populating H2 DB table through Apache ServiceMix 4.2.2

I am trying to integrate a simple Enterprise App to a data source(xml file for now) using Apache Service Mix(ASM) ESB. Basically I need to have the ESB pick up content from the xml file and populate corresponding tables in a H2 database(which my app is linked to). I am not sure as to which features of ASM I should be using for the same. If someone could give me a high level idea as to how I should be going about the same I would be very grateful. I have looked at documentation from Fuse ESB and also the ASM documentation but at this point I am totally confused.
Thanks in advance.
Since ServiceMix uses Camel for such work, my first suggestion is to take a look at Apache Camel for it.
For you're example a simple route would look like this:
from("file:location_of_file").unmarshal(registered-jaxB-structure)
.split(simple("probably_your_entities")).to("jdbc:dataSource?sql_insert");
You read your incoming file from the *location_of_file* unmarshall it since it's a XML file to your object-structure with jaxb. After that you probably need to iterate over the entities inside your xml file which is best be done with a split. Now your structure is most likely in a way you can use either for storing with jpa, sql or jdbc.

Spring Integration as embedded alternative to standalone ESB

Does anybody has an experience with Spring Integration project as embedded ESB?
I'm highly interesting in such use cases as:
Reading files from directory on schedule basis
Getting data from JDBC data source
Modularity and possibility to start/stop/redeploy module on the fly (e.g. one module can scan directory on schedule basis, another call query from jdbc data source etc.)
repeat/retry policy
UPDATE:
I found answers on all my questions except "Getting data from JDBC data source". Is it technically possible?
Remember, "ESB" is just a marketing term designed to sell more expensive software, it's not a magic bullet. You need to consider the specific jobs you need your software to do, and pick accordingly. If Spring Integration seems to fit the bill, I wouldn't be too concerned if it doesn't look much like an uber-expensive server installation.
The Spring Integration JDBC adapters are available in 2.0, and we just released GA last week. Here's the relevant section from the reference manual: http://static.springsource.org/spring-integration/docs/latest-ga/reference/htmlsingle/#jdbc
This link describes the FileSucker with Spring Integration. Read up on your Enterprise Integration patterns for more info I think.
I kinda think you need to do a bit more investigation your self, or do a couple of tries on some of your usecases. Then we can discuss whats good and bad
JDBC Adapters appear to be a work in progress.
Even if there is no specific adapter available, remember that Spring Integration is a thin wrapper around POJOs. You'll be able to access JDBC in any component e.g. your service activators.
See here for a solution based on a polling inbound channel adapter too.

Resources