Skip to content

Instantly share code, notes, and snippets.

Madan Chaudhary madan712

View GitHub Profile
@madan712
madan712 / Receiver.java
Created May 31, 2020
Receiver.java - Spring boot ActiveMQ example
View Receiver.java
package com.javaxp.testjmsclient;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
@Component
public class Receiver {
@JmsListener(destination = "myQueue")
public void readMessage(String message) {
@madan712
madan712 / TestJmsClientApplication.java
Created May 31, 2020
TestJmsClientApplication.java - Spring boot ActiveMQ example
View TestJmsClientApplication.java
package com.javaxp.testjmsclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TestJmsClientApplication {
public static void main(String[] args) {
SpringApplication.run(TestJmsClientApplication.class, args);
@madan712
madan712 / pom.xml
Created May 31, 2020
pom.xml - Spring boot ActiveMQ server
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
@madan712
madan712 / application.properties
Created May 31, 2020
application.properties - Spring boot ActiveMQ example
View application.properties
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.user=admin
spring.activemq.password=admin
@madan712
madan712 / TestJmsServerApplication.java
Last active Jun 1, 2020
TestJmsServerApplication.java - Spring boot ActiveMQ example
View TestJmsServerApplication.java
package com.javaxp.testjmsserver;
import java.time.LocalDateTime;
import javax.jms.Queue;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
@madan712
madan712 / pom.xml
Created May 31, 2020
pom.xml - Spring boot ActiveMQ server
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
@madan712
madan712 / application.yml
Created Jun 29, 2019
Spring Boot + Jasypt example to encrypted database password in property file
View application.yml
spring:
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/schema
username: user
password: ENC(xEOLuBn9FuLgpYl6O8qGwY5MVjr4w2Av)
@madan712
madan712 / Application.java
Last active Jun 29, 2019
My Sql + Spring Boot JPA - One to many, many to one example
View Application.java
package com.javaxp;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.javaxp.model.Department;
@madan712
madan712 / DepartmentRepository.java
Created Jun 29, 2019
My Sql + Spring Boot JPA - One to many, many to one example
View DepartmentRepository.java
package com.javaxp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.javaxp.model.Department;
@Repository
public interface DepartmentRepository extends JpaRepository<Department, Long> {
}
@madan712
madan712 / EmployeeRepository.java
Created Jun 29, 2019
My Sql + Spring Boot JPA - One to many, many to one example
View EmployeeRepository.java
package com.javaxp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.javaxp.model.Employee;
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
}
You can’t perform that action at this time.