-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
6 changed files
with
93 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
= Jozi JUG AWS sample application = | ||
|
||
== Setup JBoss == | ||
Start JBoss AS 7.1+ | ||
|
||
./standalone.sh [-Dlocal] --server-config=standalone-full.xml | ||
Fix the slf4j module, by editing ${JBOSS_HOME}/modules/org/jboss/logging/main/module.xml and add those two to the dependencies: | ||
|
||
<module name="org.apache.log4j"/> | ||
<module name="org.slf4j"/> | ||
'' This might be fixed by JBoss one day, but still for JBoss AS 7.1-Final does not work properly'' | ||
|
||
== Build & Deploy the war == | ||
|
||
Build the project with | ||
|
||
mvn clean install | ||
And put '''target/jozi-aws-demo-1-SNAPSHOT.war''' in ''''${JBOSS_HOME}/standalone/deployments''' | ||
|
||
== Run the application == | ||
|
||
=== JMS & Hibernate version === | ||
|
||
The optional '''-Dlocal''' will use JPA/JMS services instead of SDB/SQS | ||
Run the server with | ||
|
||
./standalone.sh -Dlocal --server-config=standalone-full.xml | ||
Deploy JMS queue with | ||
|
||
add-jms-queue --name=JoziJUGQueue --entries=queues/MessageQueue | ||
This will use JPA/JMS services. | ||
|
||
=== SQS & SDB version === | ||
|
||
Fill in aws.properties and sqs.conf in the resources folder (use .sample files) | ||
|
||
Create an empty '''messages''' domain in SDB. | ||
|
||
Run the server with | ||
|
||
./standalone.sh | ||
== Access the application == | ||
|
||
Go to [http://localhost:8080/jozi-aws-demo-1-SNAPSHOT/home/index http://localhost:8080/jozi-aws-demo-1-SNAPSHOT/home/index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 21 additions & 2 deletions
23
src/main/java/pl/softwaremill/jozijug/joziawsdemo/impl/sdb/DateFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
package pl.softwaremill.jozijug.joziawsdemo.impl.sdb; | ||
|
||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
/** | ||
* User: szimano | ||
*/ | ||
public class DateFormatter { | ||
|
||
public SimpleDateFormat getDateFormat() { | ||
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
private static final SimpleDateFormat format; | ||
|
||
static { | ||
format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | ||
format.setTimeZone(TimeZone.getTimeZone("UTC")); | ||
} | ||
|
||
public String formatDate(Date date) { | ||
return format.format(date); | ||
} | ||
|
||
public Date parseDate(String dateString) { | ||
try { | ||
return format.parse(dateString); | ||
} catch (ParseException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters