Using SolrJ REST-API to query data in a Spring Application - spring

I have solr running at http://localhost:8983/solr/ . I have a Spring MVC app running at http://localhost:8080/login.jsp .
I would like to be able to Query only the solr data from my spring app. What is the best way to go about this? Does someone have a simple running example?

Integrate Solr with Spring using SolrJ.
SolrJ is the Solr Java Client Library which will allow you to query Solr and get back the results in java objects which you can use as Model objects with Spring MVC.
You can easily create a Repository which interacts with Solr using Solrj.
Also, secure the Solr Collections so that no one can access Solr from direct URL without authentication.
The Solrj Client with the Spring MVC app can query SOlr with Authentication.

You can also use spring-data-solr to do so. It should integrate quite nicely into an existing spring MVC application.

Related

Opinions on what should I use if I want to make a REST API with REACT: Django Rest Framework or Java Spring Boot

what do you think is better for an application to be developed in 2/3 months.
The frontend will use React.
For the backend I would like to implement a Rest API and I am in doubt whether to use Java Spring Boot or Django Rest Framework.
Other people's recommendation is to use Java Spring Boot, since Django uses the templating engine and I wouldn't use them for anything, just use Django for the Django Rest Framework (and everything else it embeds).
You would have two databases, one with MongoDb and the other in Postgresql. For Postgresql if I use Java Spring the ORM would be Hibernate and if I use Django the ORM would be Django ORM. For MongoDb if I use Java Spring I would still use python with mongoengine to collect the data.
MongoDb will be use to storage data for a recommender model.
Thank you!
Ideas or a solution about my architectureto problem.

How to store a JSON object in couchbase using springboot

I am new to spring boot and I am developing a simple spring boot API to store data to a couchbase db. Storing JSON objects have different formats.Is there any suitable method to achieve this?
Couchbase has given support for the JAVA SDK's that can help you easily integrate the couchbase api's and access the couchbase server to perform CRUD operation's here is the tutorial available : JAVA SDK
And also please take a look at this blog couchbase with Spring Boot sample example

Spring MongoDB and GraphQL

We want to try GraphQL in our Spring based application. (its not based on spring boot). Our data repository is MongoDB. I saw various examples based on node, which makes use of graphQL + Mongo. There is also library which is with spring boot!
Can it be used directly? Or there is non spring-boot lib available?
The main thing you'd gain from Spring Boot is auto configuration for Spring Data's Mongo driver.
If you're comfortable injecting the MongoRepository into the GraphQL data sources and resolves on your own, then no, you don't need Spring Boot

Does Hybris use Spring Framework?

I am trying to understand and get some information for the Hybris platform. Does it use Spring Framework? Also could anyone please share the link / material to have more understanding about it's architecture, technology, etc ?
As per my research, they use:
Technology:
Spring MVC, JSF (FrontEnd), REST Web services ?????
User Interfaces:
Product Cockpit, CMS Cockpit, Print Cockpit, Admin Cockpit, HMC
Platform:
Persistance, Caching, Security, Internationalization, Import/Export, Search
App Server:
Hybris Server, Oracle BEA, IBM, JBoss
Database:
Oracle, SqlServer, Mysql
IMP: Does SAP Hybris support for Spring REST. I think since it uses Spring MVC + Security, so restful web services should of Spring REST only. I heard that it also support RestEasy and Jersey, but not good option when you have a Spring REST in place which adds great support than RestEasy and Jersey. Can you bring in details ?
Can someone please answer to the above IMP query ? Also please share sample RestFul web service of SAP Hybris.
Hybris uses the following technologies:
Java, Spring, Apache SOLR, Groovy, Scala, Apache Commons, ZK framework, Google Analytics, Jasper Reports, Tomcat.
You can find the best information on the architecture of hybris here.
You need a SAP Hybris login for this.
Spring core, Spring MVC.
JSP, javascript, CSS, bootstrap for the frontend.
java 8 for the backend.
apache Solr as the search engine.
tomcat, spring tc server, oracle, IBM as server.
hsqldb, oracle, IBM SAP HANA, MySql, Percona etc as database.
hybris does use spring and many other frameworks (like zk, groovy, scala). They have there own persistence layer and they does use the MVC pattern a lot. As hybris provide a lot of different services and interfaces it is not clearly only one architecture.
e.g. the "datahub" is a communication gateway based on spring integration, but Independent from the base platform.
Hybris use spring mvc spring security. it is compatible with Mysql, HANA, Oracle, sqlserver etc. Also it comes with charon api which make it easy to interact with yaas platform specially designed to fulfill the requirement of other ecommerce feature. you can access it through following link : click [here]:help.hybris.com
But again it is not free. You can also try on http://www.slideshare.net/

Spring JPA with Jersey

I am writing a rest service using Jersey. The data access layer will be developed using Spring JPA. I will be interested to know how can I pass database properties to the Repository layer.
take a look at #Blaise Doughan's answer to a similar question
How to insert data from database with Web Service in java using JAX - RS

Resources