Skip to content

Commit

Permalink
Merge pull request stewartfrancis#2 from hobbit1983/master
Browse files Browse the repository at this point in the history
Purge the queue
  • Loading branch information
stewartfrancis authored Oct 16, 2019
2 parents 7f5b427 + 64b5850 commit e6a69a6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion explorer/demo-explorer-bundle/META-INF/cics.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<manifest xmlns="http://www.ibm.com/xmlns/prod/cics/bundle" id="demo-explorer-bundle" bundleMajorVer="0" bundleMinorVer="0" bundleMicroVer="1" bundleVersion="1" bundleRelease="0" build="IntB-201809142129">
<meta_directives>
<timestamp>2019-10-14T02:05:48.841+01:00</timestamp>
<timestamp>2019-10-15T10:12:42.091+02:00</timestamp>
</meta_directives>
<define name="demo-explorer-war" type="http://www.ibm.com/xmlns/prod/cics/bundle/WARBUNDLE" path="demo-explorer-war.warbundle"/>
</manifest>
12 changes: 11 additions & 1 deletion explorer/demo-explorer-war/src/demo/SimpleServletFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
tsq = new TSQ();
tsq.setName(SimpleServlet.TSQ_NAME);
tsq.setType(TSQType.MAIN);
purgeQueue(tsq);

Faker faker = new Faker();

Expand Down Expand Up @@ -61,7 +62,16 @@ public void destroy() {
try {
tsq.delete();
} catch (CicsConditionException e) {
throw new RuntimeException(e);
//throw new RuntimeException(e);
}
}

private void purgeQueue(TSQ tsq){
try{
tsq.delete();
}catch(CicsConditionException cce){
//purging the queue will fail if the queue doesn't exist
//so ignore this exception
}
}

Expand Down
12 changes: 11 additions & 1 deletion maven/demo-war/src/main/java/demo/SimpleServletFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
tsq = new TSQ();
tsq.setName(SimpleServlet.TSQ_NAME);
tsq.setType(TSQType.MAIN);
this.purgeQueue(tsq);

Faker faker = new Faker();

Expand Down Expand Up @@ -61,7 +62,16 @@ public void destroy() {
try {
tsq.delete();
} catch (CicsConditionException e) {
throw new RuntimeException(e);
//throw new RuntimeException(e);
}
}

private void purgeQueue(TSQ tsq){
try{
tsq.delete();
}catch(CicsConditionException cce){
//purging the queue will fail if the queue doesn't exist
//so ignore this exception
}
}

Expand Down

0 comments on commit e6a69a6

Please sign in to comment.