Skip to content

Commit 3225470

Browse files
authored
Merge pull request eugenp#8125 from eugenp/revert-8119-BAEL-3275-2
Revert "BAEL-3275: Using blocking queue for pub-sub"
1 parent db85c8f commit 3225470

File tree

20,543 files changed

+1642459
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

20,543 files changed

+1642459
-0
lines changed

.gitignore

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
*/bin/*
2+
bin/
3+
4+
*.class
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
12+
# Eclipse
13+
.settings/
14+
*.project
15+
*.classpath
16+
.prefs
17+
*.prefs
18+
.metadata/
19+
20+
# Intellij
21+
.idea/
22+
*.iml
23+
*.iws
24+
out/
25+
26+
# VSCode
27+
.vscode/
28+
29+
# Mac
30+
.DS_Store
31+
32+
# Maven
33+
log/*
34+
target/
35+
36+
# Gradle
37+
.gradle/
38+
39+
spring-openid/src/main/resources/application.properties
40+
.recommenders/
41+
/spring-hibernate4/nbproject/
42+
spring-security-openid/src/main/resources/application.properties
43+
44+
spring-all/*.log
45+
46+
SpringDataInjectionDemo/.mvn/wrapper/maven-wrapper.properties
47+
48+
spring-call-getters-using-reflection/.mvn/wrapper/maven-wrapper.properties
49+
50+
spring-check-if-a-property-is-null/.mvn/wrapper/maven-wrapper.properties
51+
*.springBeans
52+
53+
20171220-JMeter.csv
54+
55+
.factorypath
56+
dependency-reduced-pom.xml
57+
*.so
58+
*.dylib
59+
*.dll
60+
61+
xml/src/test/resources/example_dom4j_new.xml
62+
xml/src/test/resources/example_dom4j_updated.xml
63+
xml/src/test/resources/example_jaxb_new.xml
64+
core-java-io/hard_link.txt
65+
core-java-io/target_link.txt
66+
core-java/src/main/java/com/baeldung/manifest/MANIFEST.MF
67+
ethereum/logs/
68+
jmeter/src/main/resources/*-JMeter.csv
69+
70+
**/node_modules/
71+
**/dist
72+
**/tmp
73+
**/out-tsc
74+
**/nbproject/
75+
**/nb-configuration.xml
76+
core-scala/.cache-main
77+
core-scala/.cache-tests
78+
79+
80+
persistence-modules/hibernate5/transaction.log
81+
apache-avro/src/main/java/com/baeldung/avro/model/
82+
jta/transaction-logs/
83+
software-security/sql-injection-samples/derby.log
84+
spring-soap/src/main/java/com/baeldung/springsoap/gen/
85+
/report-*.json
86+
transaction.log
87+
*-shell.log
88+
89+
apache-cxf/cxf-aegis/baeldung.xml
90+
apache-fop/src/test/resources/input.xml
91+
apache-fop/src/test/resources/output_herold.pdf
92+
apache-fop/src/test/resources/output_html2fo.pdf
93+
apache-fop/src/test/resources/output_jtidy.pdf

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Eugen Paraschiv
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
The Courses
3+
==============================
4+
5+
6+
Here's the new "Learn Spring" course: <br/>
7+
**[>> LEARN SPRING - THE MASTER CLASS](https://www.baeldung.com/learn-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=ls#master-class)**
8+
9+
Here's the Master Class of "REST With Spring" (along with the new announced Boot 2 material): <br/>
10+
**[>> THE REST WITH SPRING - MASTER CLASS](https://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=rws#master-class)**
11+
12+
And here's the Master Class of "Learn Spring Security": <br/>
13+
**[>> LEARN SPRING SECURITY - MASTER CLASS](https://www.baeldung.com/learn-spring-security-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=lss#master-class)**
14+
15+
16+
17+
Java and Spring Tutorials
18+
================
19+
20+
This project is **a collection of small and focused tutorials** - each covering a single and well defined area of development in the Java ecosystem.
21+
A strong focus of these is, of course, the Spring Framework - Spring, Spring Boot and Spring Security.
22+
In additional to Spring, the modules here are covering a number of aspects in Java.
23+
24+
25+
Building the project
26+
====================
27+
To do the full build, do: `mvn clean install`
28+
29+
30+
Building a single module
31+
====================
32+
To build a specific module run the command: `mvn clean install` in the module directory
33+
34+
35+
Running a Spring Boot module
36+
====================
37+
To run a Spring Boot module run the command: `mvn spring-boot:run` in the module directory
38+
39+
40+
Working with the IDE
41+
====================
42+
This repo contains a large number of modules.
43+
When you're working with an individual module, there's no need to import all of them (or build all of them) - you can simply import that particular module in either Eclipse or IntelliJ.
44+
45+
46+
Running Tests
47+
=============
48+
The command `mvn clean install` will run the unit tests in a module.
49+
To run the integration tests, use the command `mvn clean install -Pintegration-lite-first`
50+
51+
52+
53+
54+

akka-http/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Akka HTTP
2+
3+
This module contains articles about Akka HTTP.
4+
5+
### Relevant articles:
6+
7+
- [Introduction to Akka HTTP](https://www.baeldung.com/akka-http)

akka-http/pom.xml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6+
7+
<modelVersion>4.0.0</modelVersion>
8+
<artifactId>akka-http</artifactId>
9+
<name>akka-http</name>
10+
11+
<parent>
12+
<artifactId>parent-modules</artifactId>
13+
<groupId>com.baeldung</groupId>
14+
<version>1.0.0-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.typesafe.akka</groupId>
20+
<artifactId>akka-http_2.12</artifactId>
21+
<version>${akka.http.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.typesafe.akka</groupId>
25+
<artifactId>akka-stream_2.12</artifactId>
26+
<version>${akka.stream.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.typesafe.akka</groupId>
30+
<artifactId>akka-http-jackson_2.12</artifactId>
31+
<version>${akka.http.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>com.typesafe.akka</groupId>
35+
<artifactId>akka-http-testkit_2.12</artifactId>
36+
<version>${akka.http.version}</version>
37+
<scope>test</scope>
38+
</dependency>
39+
</dependencies>
40+
41+
<properties>
42+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44+
<akka.http.version>10.0.11</akka.http.version>
45+
<akka.stream.version>2.5.11</akka.stream.version>
46+
</properties>
47+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.baeldung.akkahttp;
2+
3+
public class User {
4+
5+
private final Long id;
6+
7+
private final String name;
8+
9+
public User() {
10+
this.name = "";
11+
this.id = null;
12+
}
13+
14+
public User(Long id, String name) {
15+
this.name = name;
16+
this.id = id;
17+
}
18+
19+
public String getName() {
20+
return name;
21+
}
22+
23+
public Long getId() {
24+
return id;
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.baeldung.akkahttp;
2+
3+
import akka.actor.AbstractActor;
4+
import akka.actor.Props;
5+
import akka.japi.pf.FI;
6+
import com.baeldung.akkahttp.UserMessages.ActionPerformed;
7+
import com.baeldung.akkahttp.UserMessages.CreateUserMessage;
8+
import com.baeldung.akkahttp.UserMessages.GetUserMessage;
9+
10+
11+
class UserActor extends AbstractActor {
12+
13+
private UserService userService = new UserService();
14+
15+
static Props props() {
16+
return Props.create(UserActor.class);
17+
}
18+
19+
@Override
20+
public Receive createReceive() {
21+
return receiveBuilder()
22+
.match(CreateUserMessage.class, handleCreateUser())
23+
.match(GetUserMessage.class, handleGetUser())
24+
.build();
25+
}
26+
27+
private FI.UnitApply<CreateUserMessage> handleCreateUser() {
28+
return createUserMessageMessage -> {
29+
userService.createUser(createUserMessageMessage.getUser());
30+
sender().tell(new ActionPerformed(String.format("User %s created.", createUserMessageMessage.getUser()
31+
.getName())), getSelf());
32+
};
33+
}
34+
35+
private FI.UnitApply<GetUserMessage> handleGetUser() {
36+
return getUserMessageMessage -> {
37+
sender().tell(userService.getUser(getUserMessageMessage.getUserId()), getSelf());
38+
};
39+
}
40+
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.baeldung.akkahttp;
2+
3+
import java.io.Serializable;
4+
5+
public interface UserMessages {
6+
7+
class ActionPerformed implements Serializable {
8+
9+
private static final long serialVersionUID = 1L;
10+
11+
private final String description;
12+
13+
public ActionPerformed(String description) {
14+
this.description = description;
15+
}
16+
17+
public String getDescription() {
18+
return description;
19+
}
20+
}
21+
22+
class CreateUserMessage implements Serializable {
23+
24+
private static final long serialVersionUID = 1L;
25+
private final User user;
26+
27+
public CreateUserMessage(User user) {
28+
this.user = user;
29+
}
30+
31+
public User getUser() {
32+
return user;
33+
}
34+
}
35+
36+
class GetUserMessage implements Serializable {
37+
private static final long serialVersionUID = 1L;
38+
private final Long userId;
39+
40+
public GetUserMessage(Long userId) {
41+
this.userId = userId;
42+
}
43+
44+
public Long getUserId() {
45+
return userId;
46+
}
47+
}
48+
49+
}

0 commit comments

Comments
 (0)