Tuesday 25 February 2020

All About JMS and Queue Configuration


How to configure JMS on Weblogic Server 12c

JMS Server:
A JMS server acts as a management container for resources which are available in JMS  modules. Some of its responsibilities include the maintenance of  persistence and state of messages and subscribers. A JMS server is  required in order to create a JMS module.

JMS Module:
A JMS module contains JMS resources such as queues/topics. A JMS module is required in order to create a JMS queue.

Subdeployment:
JMS modules are targeted to one or more WLS instances or a cluster.  Resources within a JMS module, such as queues and topics are also targeted to a JMS server or WLS server instances. A subdeployment is a grouping of targets. It is also known as advanced targeting.

Connection Factory:
A connection factory is a resource that enables JMS clients to create connections to JMS destinations.

JMS Queue:
A JMS queue (as opposed to a JMS topic) is a point-to-point destination type. A message is written to a specific queue or received from a specific queue.

The objects used in this example are:

Object Name
Type
JNDI Name
DemoJMSServer
JMS Server

DemoJMSModule
JMS Module

DemoSubDeployment
Subdeployment

DemoConnectionFactory
Connection Factory
jms/DemoConnectionFactory
DemoJMSQueue
JMS Queue
jms/DemoJMSQueue





--------------------------------------------------

   1. JMS Server Configuration Steps:

    1.1. Create a JMS Server: Services > Messaging > JMS Servers




1.2. Select New

1.3  Name: DemoJMSServer


                  Persistent Store: (Click on Create a New Store )- 

Select Type ="JDBC Store" and click next

Provide below details - 


Click next and finish. then select the newly created JDBC Store and click next -
1.4. Target: soa_server1 (or choose an available server)



1.5.  Finish - Click Finish.
The JMS server should now be visible in the list with Health OK.



--------------------------------------------

2. JMS Module Configuration Steps :


2.1.  Services > Messaging > JMS Modules
2.2.  Select New
2.3.  Name: DemoJMSModule  and  Leave the other options to  default



2.4.  Targets: soa_server1 (or choose the same one as the JMS server)
        PressNext


2.5.  Leave “Would you like to add resources to this JMS system
        module” unchecked and  pressFinish.


DemoJMSModule   is created successfully.



--------------------------------------------------

3. Create a SubDeployment : 

A subdeployment is not necessary for the JMS queue to work, but it allows you to easily target subcomponents of the JMS module to a single target or group of targets. We will use the subdeployment in this example to target the following connection factory and JMS queue to the JMS server we created earlier.

3.1. Services > Messaging > JMS Modules
3.2. Select DemoJMSModule
3.3. Click on Subdeployments tab and New



3.4. Subdeployment Name: DemoSubdeployment



3.5. Press Next
3.6. Select Target - Here you can select the target(s) for the subdeployment. You can choose either Servers (i.e. WebLogic managed servers, such as the soa_server1) or JMS Servers such as the JMS Server created earlier. 
As the purpose of our subdeployment in this example is to target a specific JMS server, we will choose the JMS Server option.
Select the DemoJMSServer created earlier

3.7. Press Finish


--------------------------------------

4. Create a Connection Factory

4.1. Services > Messaging > JMS Modules
4.2. Click on DemoJMSModule and press New


4.3. Select Connection Factory and Next



4.4. Name: DemoConnectionFactory
JNDI Name: jms/DemoConnectionFactory
Leave the other values at default



4.5. On the Targets page, select the Advanced Targeting button and select DemoSubdeployment



4.6. Press Finish
The connection factory should be listed on the following page with DemoSubdeployment and DemoJMSServer as the target.
----------------------------------------------

5 Create a JMS Queue

5.1. Services > Messaging > JMS Modules
5.2. Click on  DemoJMSModule and press New
5.3. Select Queue and Next



5.4. Name: DemoJMSQueue
JNDI Name: jms/DemoJMSQueue
Template:None
PressNext



5.5. Subdeployments: DemoSubdeployment



5.6. Finish
The DemoJMSQueue should be listed on the following page with  DemoSubdeployment and DemoJMSServer.




Release Configuration.

The JMS queue is now complete and can be accessed using the JNDI names
jms/DemoConnectionFactory
jms/DemoJMSQueue.



Keep Learning ! Cheers Guys!!

Kavindra Sahu


Tuesday 18 February 2020

DataSource, JNDI Creation DB & FTP on Weblogic Server

******************* DataSource Creation on Weblogic Server **************************


1. Login into WebLogic Console. The default URL is http://<HOSTNAME>:<PORT>/console


2. Click Data Sources under services,





Click New and select Generic Data Source


3. Input a Name, Scope as Global, JNDI Name for your code to lookup, and Database Type (Oracle, My SQL, etc.,)



4.  Accept the default and click Next



5.
6.


7. Click on test configuration- Then click on next


8. Then click on next, select target, then click on finish.




This way data source has been created.





****************    JNDI Configurations for Database ***************** 



1. JNDI Configurations for DB

----------------------------------------------
1.a. Log into  Console -  http://<HOSTNAME>:<PORT>/console
1.b Lock and Edit

Create  outbound Connection poll in DBAdapter
----------------------------------------------

1.c    Goto Deployments --> DBAdapter --> Configuration --> Outbound Connection Pools ---> New



1.d   Select javax.resource.cci.ConnectionFactory --> Next -> Privde JNDI Name below --> Finish



     JNDI Name: eis/DB/TestDB


1.e  Expand javax.resource.cci.ConnectionFactory--> Click on eis/DB/TESTDB


Enter below details  in Outbound Connection Properties


     PlatformClass: org.eclipse.persistence.platform.database.Oracle10Platform --> Enter to Save



     XADataSourceName: jdbc/TestDB--> Enter to Save





1.f Save and Activate changes


Again take lock & Edit then -
1.g   Goto Deployments --> Select DBAdapter and update DBAdapter.

After successful update , it will show like below.




JNDI           - eis/DB/TESTDB
DataSource -  jdbc/TestDB

JNDI is confifured successfully.
-----------------------------------------

======================================================================

****************    JNDI Configurations for FTP ***************** 


2. JNDI Configurations for FTP
----------------------------------------------

2.a. Log into  Weblogic Console -  http://<HOSTNAME>:<PORT>/console

2.b Lock and Edit
Create FTP outboundpool connection.
 -------------------------------

2.c    Goto Deployments --> FTPAdapter --> Configuration --> Outbound Connection Pools ---> New

Select javax.resource.cci.ConnectionFactory --> Next -> Privde JNDI Name below --> Finish


     JNDI: eis/sftp/testftp


2.d Click on eis/sftp/testftp

Enter below details  in Outbound Connection Properties
     username: username Enter to Save
     password:Password Enter to Save
     Host: ftp.abcftp.com
     UseSftp : true Enter to Save


2.e Save and Activate changes 

First Take lock & Edit then 
2.f   Goto Deployments --> and select FTP Adapter and update FTP Adapter.


Release Configuration.

Keep Learning ! Cheers Guys!!

Kavindra Sahu

String to QR Code Image Generator Using Java

 Hi , Hope You are doing well. I came up with the requirement, where I need to generate QR code Image file for the input String. package dem...