How to create a datasource for mongodb in websphere - mongodb

Can some one help in providing steps for creating a datasource for mongodb in websphere

A recommended approach for using the MongoDB java driver in WebSphere Application Server Liberty is documented here:
https://openliberty.io/blog/2019/02/19/mongodb-with-open-liberty.html
If you are using traditional WebSphere Application Server rather than Liberty, the CDI aspect of the approach is all standard and will work there as well, however, the MicroProfile Config part would not be available.

Related

REST Spring Boot Web Service on Websphere 9

I want to create a Spring Boot REST Web Service and deploy and publish it in Traditional Websphere 9 Application Server. Is it possible ?
What all challenges I might encounter? Can someone please provide me few pointers for reference?
Yes this can be done. It is not a good design, but yes it can be done. Back in the day when I was working for a big bank, they deployed java spring-boot microservices in IBM websphere(Not liberty).
How to do it?
1) Package your deployable as war. You can do this by editing your pom to package as WAR.
2) You can either add connection string config in your springboot starter class or get a JNDI created in the websphere instance. We observed that performance of the API's improved when the app used websphere JNDI as opposed to app created connection bean.
3) If you use IBM MQ, the best course of action is get a non-ssl and ssl based channel created at MQ and a JNDI for the MQ connection as well.
4) If you plan to create MQ connection beans within the app, like we did, ensure the JKS file has all the valid set of signers of your org.
Problems we faced
1) Our app used a lot of third party rule engine like drools, so ensure the websphere server.xml is configured to servlet version 3.1 or higher
2) Webshpere admin console is helpful, but don't just blindly believe if it says green to your container, always check your app logs for errors.
3) Common pain points are establishing a successful connection with IBM MQ host. Get a MQ server admin to troubleshoot all MQRC errors.
4) If you plan to use Oracle as backend, ensure the DBA has created a wallet for you to enable both SSL and Non SSL connections. Some organisations are picky with non-sssl db connections. It is easier to handle all this if you leverage webspehere JNDI for DB connections.
Let me know if this helped.
Both WebSphere Traditional and WebSphere Liberty support Spring boot.
Are you looking for something like this?
http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/

MongoDB datasource configuration in jbossas

I am using Openshift JBOSS server. I would like to configure external MongoDB in JBOSS.
Is it possible to configure MongoDB as a datasource in JBOSS server ?
You could try taking a look at this quickstart: https://github.com/openshift-quickstart/jbossas-mongoDB-quickstart. I was able to create a JBoss application with mongodb following the instructions listed there.
If you don't want to create a new application from scratch you should be able to borrow some of the code and apply it to your application and then just add the mongodb cartridge.

Datasource configurations compatible with JBOSS versions

There are couple of datasource configuration files for XA and NON-XA datasource in JBOSS v4.2.3 for the various need of the deployed applications in the jboss environment. Also the DB passwords are encrypted using the JBOSS provided techniques (some datasources are created using JaasSecurityDomain and some use SecureIdentityLoginModule) .
How these datasource configurations and these encryption methodologies are going to behave in jboss v5 and jbossv7 ?
Is there any JBOSS tool/utility to convert the datasource to the corresponding new JBOSS version and also take care of the encryption password part ?
What is the best way to migrate these datasources created with the password encrypted.
Any help in this topic is highly appreciated .
Regards,
Jiten
Take a look at Windup project http://windup.jboss.org/
that is aiming to provide as automated upgrade as possible.

start solrserver deployed inside tomcat from within eclipse

I am working in windows 7 machine.I want to implement search using apache solr with hbase ta
bles as datasource. I have configured apache solr 4.3.1 in tomcat 7. I can able to deploy it successfully by manually starting tomcat server.
When i try to start solr server from within spring mvc web application it says solrserver started,but when i query the solr its giving the following without any errors:
page 0 of 0 containing UNKNOWN instances
As per my research on solr, it is mentioned embedded solrserver is unfit for production so i need to have httpsolrserver.
So somebody help me clear my head and give me some solution...
Thanks in advance..
For production, you would be better with hosting Solr as a seperate instance.
This would keep the responsibility separate, web application and search engine.
Indexing process are resource intensive and would the web application behavior as well.
This can be catered by Master Slave arch, providing best search performance.
External instance can be scaled at will and would not impact the web application.

TC Server Vs JBoss Server

We are planning to migrate to a new WebServer (bye bye Websphere), the main considerations are
transaction management
persistence
message/event handling
maintainability
distributed architecture
MBD/EJB support
We are very happy with TC Server but the only problem is that it does not support EJB's and MDB's and we use them pretty heavily here, I head that you can use TC Server and JBoss together, did anybody try using it that way or is there other way that we can use EJB's and MDB's with TC Server ?
Any help appreciated
/srm
If by TC you mean Apache's Tomcat, then yes: JBoss AS is bundled with an embedded Tomcat Servlet/JSP container. So, if you are happy with Tomcat, then JBoss might be a good option for you. And it supports all things you've mentioned.
JTA
JPA/Hibernate
JMS and MDB
Yes, you can have JBoss AS in cluster provided your application supports it
Of course. JavaEE containers must support MDB and EJB.