Wednesday, 15 August 2018

Webhook - Rest EndPoint to Spring Kafka Topic

Use case is to expose a Rest API for execution of  any logic and trigger backend  systems for n number of transaction , invocation or transactions.

Technology Stack : JEE, Spring Boot , Spring - Kafka Template.


1) Start the Kafka and Zoo Keeper Server. (This is required specially for component connection from spring kafka)

2) Run the Spring Boot Micro Service it will connect to the kafka topics, etc on startup.

3) Rest Endpoint will be exposed as a API resource which takes  a Json Object which can be categorized and developed based on the requirement.

4) Once the rest endpoint message is sent , the exposed api uses the already connected Topic and  directly drops the message in the kafka topic.

5) @KafkaListener can be used to read these messages dropped to the topic. These can now be used to invoke or trigger any actions required based on the business use case.


Source link on git  : - https://github.com/sanalsamuel/WebhookToKafka

Angular 4 CLI - NodeJs , NPM

IDE - Atom - need to try webstorm

Angular CLI

1) Download and install Node Server , it installs npm for you.

2) NPM and Node version check.

3) npm install -g @angular/Cli

4) Create your App with the command.  (Creates the Entire Structure )
     ng new MyApp

5)  ng serve

APP is now running on http://localhost:4200/

Next Items :- Components and Routers -- Coming Soon

6) Create a build :- ng build --prod  - creates a build folder called dist - this can be used for future deployment process

Tuesday, 7 August 2018

Oracle Queries for Java Developers



1) Connection count for all users 

select sum(case when status = 'ACTIVE' then 1 else 0 end) as ACTIVE_COUNT
     , sum(case when status = 'INACTIVE' then 1 else 0 end) as INACTIVE_COUNT
     , count(*) as TOTAL_COUNT
     , username, machine
from   v$session
where type <> 'BACKGROUND'
group by username, machine
order by username, machine



2) Session and Process count 

  select resource_name, current_utilization, max_utilization, limit_value
   from v$resource_limit
   where resource_name in ('sessions', 'processes');

3) Alter Session and Process Value

alter system set processes=500 scope=spfile;

alter system set sessions=1248 scope=spfile;

4) How to make changes in oracle DB 

Connect to SQL+ common prompt  

1) Command: connect sys as sysdba

you will be asked for password , now your logged in to the system shows prompt connected.

2) Grant privileges to user 

grant sysdba to system;   (system is the user)


3)   Alter user password or change password 
Alter user sys identified by new_password;   (sys is user and new_password is the password value)

4) Unlock a user account 
 Alter user system account unlock;    

5). Revoke rights from a user 
Revoke sysdba from system;

AWS Certificate Manager - Import Certificate

How to import a certificate. Use Key Store Explorer to open the cert and export keypair in PEM format  This will save a file cert.pem. Make ...