Skip to content

Commit 21c59fb

Browse files
committed
Merge branch 'xray-gettingstarted' into xray
2 parents db7e623 + e8abe7f commit 21c59fb

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ The `master` branch shows the use of Spring, Angular, nginx, the [AWS SDK for Ja
5151
Other branches extend the application's functionality and show the use of other AWS services. See the readme in each branch for details about the integration and instructions for use.
5252

5353
**Branches**
54-
- [`cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito) - Support login and store users in an [Amazon Cognito](http://aws.amazon.com/cognito) user pool.
54+
- [`cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito) - Support login and store users in an [Amazon Cognito](http://aws.amazon.com/cognito) user pool. Get AWS SDK credentials and make service calls with a Cognito identity pool.
55+
- [`cognito-basic`](https://github.com/awslabs/eb-java-scorekeep/tree/cognito-basic) - Use Cognito for user ID storage. User pool only, no identity pool.
5556
- [`lambda`](https://github.com/awslabs/eb-java-scorekeep/tree/lambda) - Call an [AWS Lambda](http://aws.amazon.com/lambda) function to generate random names.
5657
- [`sql`](https://github.com/awslabs/eb-java-scorekeep/tree/sql) - Use JDBC to store game histories in an attached PostgreSQL database instance.
57-
- [`xray`](https://github.com/awslabs/eb-java-scorekeep/tree/xray) - Use the [AWS X-Ray SDK for Java](http://docs.aws.amazon.com/xray-sdk-for-java/latest/javadoc/) to instrument incoming requests, SDK clients, SQL queries, HTTP clients, and sections of code.
58+
- [`xray`](https://github.com/awslabs/eb-java-scorekeep/tree/xray) - Use the [AWS X-Ray SDK for Java](http://docs.aws.amazon.com/xray-sdk-for-java/latest/javadoc/) to instrument incoming requests, functions, SDK clients, SQL queries, HTTP clients, startup code, and AWS Lambda functions.
59+
- [`xray-cognito`](https://github.com/awslabs/eb-java-scorekeep/tree/xray-cognito) - Use AWS credentials obtained with Amazon Cognito to upload trace data to X-Ray from the browser.
5860
- [`xray-gettingstarted`](https://github.com/awslabs/eb-java-scorekeep/tree/xray-gettingstarted) ([tutorial](https://docs.aws.amazon.com/xray/latest/devguide/xray-gettingstarted.html)) - Use the AWS X-Ray SDK for Java to instrument incoming requests and SDK clients (no additional configuration required).
5961

6062
Use the procedures in the following sections to run the project on Elastic Beanstalk and configure it for local testing and development.
@@ -108,7 +110,7 @@ Deploy the source code for the project to your Elastic Beanstalk environment.
108110

109111
**To deploy the source code**
110112

111-
1. Download the source bundle: [eb-java-scorekeep-v1.zip](https://github.com/awslabs/eb-java-scorekeep/releases/download/v1.3/eb-java-scorekeep-v1.zip)
113+
1. Download the source bundle: [eb-java-scorekeep-v1.zip](https://github.com/awslabs/eb-java-scorekeep/releases/download/v1.5/eb-java-scorekeep-v1.zip)
112114
2. Open the [Elastic Beanstalk console](console.aws.amazon.com/elasticbeanstalk/home).
113115
3. Choose your environment's name to open the Dashboard.
114116
4. Choose **Upload and Deploy**.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies {
4646
dependencyManagement {
4747
imports {
4848
mavenBom("com.amazonaws:aws-java-sdk-bom:1.11.67")
49-
mavenBom("com.amazonaws:aws-xray-recorder-sdk-bom:1.1.2")
49+
mavenBom("com.amazonaws:aws-xray-recorder-sdk-bom:1.2.0")
5050
}
5151
}
5252
task wrapper(type: Wrapper) {

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<title>Scorekeep</title>
55
<meta charset="utf-8"/>
66
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
7-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-route.js"></script>
8-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-resource.js"></script>
7+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-route.js"></script>
8+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-resource.js"></script>
99
<script src="app/scorekeep.js"></script>
1010
<script src="app/routes.js"></script>
1111
<script src="app/services.js"></script>

src/main/java/scorekeep/MoveFactory.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
import java.util.List;
55
import java.util.Set;
66
import java.lang.Class;
7+
import java.lang.Thread;
78
import java.lang.reflect.Method;
89
import java.lang.reflect.InvocationTargetException;
10+
911
import org.slf4j.Logger;
1012
import org.slf4j.LoggerFactory;
1113

@@ -16,7 +18,7 @@ public class MoveFactory {
1618
private final StateModel stateModel = new StateModel();
1719
private final GameController gameController = new GameController();
1820
private final StateController stateController = new StateController();
19-
private final RulesFactory rulesFactory = new RulesFactory();
21+
private final RulesFactory rulesFactory = new RulesFactory();
2022

2123
public MoveFactory(){
2224
}
@@ -58,7 +60,12 @@ public Move newMove(String sessionId, String gameId, String userId, String moveT
5860
State newState = new State(stateId, sessionId, gameId, newStateText, newTurn);
5961
// send notification on game end
6062
if ( newStateText.startsWith("A") || newStateText.startsWith("B")) {
61-
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
63+
Thread comm = new Thread() {
64+
public void run() {
65+
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
66+
}
67+
};
68+
comm.start();
6269
}
6370
// register state and move id to game
6471
gameController.setGameMove(sessionId, gameId, moveId);

src/main/java/scorekeep/UserFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public String randomName() throws IOException {
5858
Map<String, String> jsonMap = mapper.readValue(inputStream, Map.class);
5959
String name = jsonMap.get("name");
6060
EntityUtils.consume(entity);
61+
Sns.sendNotification("Scorekeep user created", "Name: " + name);
6162
return name;
6263
} finally {
6364
response.close();

0 commit comments

Comments
 (0)