File tree Expand file tree Collapse file tree
openmessaging-api-samples/src/main/java/io/openmessaging/samples/producer
openmessaging-api/src/main/java/io/openmessaging/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import io .openmessaging .api .OMS ;
2323import io .openmessaging .api .SendResult ;
2424import io .openmessaging .api .transaction .LocalTransactionChecker ;
25- import io .openmessaging .api .transaction .LocalTransactionExecutor ;
25+ import io .openmessaging .api .transaction .LocalTransactionExecuter ;
2626import io .openmessaging .api .transaction .TransactionProducer ;
2727import io .openmessaging .api .transaction .TransactionStatus ;
2828import java .util .Properties ;
@@ -51,7 +51,7 @@ public void run() {
5151 Message message = new Message ("NS://Topic" , "TagA" , "Hello MQ" .getBytes ());
5252
5353 //Sends a transaction message to the specified destination synchronously.
54- SendResult result = producer .send (message , new LocalTransactionExecutor () {
54+ SendResult result = producer .send (message , new LocalTransactionExecuter () {
5555 @ Override public TransactionStatus execute (Message message , Object arg ) {
5656 return TransactionStatus .CommitTransaction ;
5757 }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public class OnExceptionContext {
3333 /**
3434 * Detailed exception stack information.
3535 */
36- private OMSRuntimeException omsRuntimeException ;
36+ private OMSRuntimeException exception ;
3737
3838 public String getMessageId () {
3939 return messageId ;
@@ -51,11 +51,12 @@ public void setTopic(String topic) {
5151 this .topic = topic ;
5252 }
5353
54- public OMSRuntimeException getOmsRuntimeException () {
55- return omsRuntimeException ;
54+
55+ public OMSRuntimeException getException () {
56+ return exception ;
5657 }
5758
58- public void setOmsRuntimeException (OMSRuntimeException omsRuntimeException ) {
59- this .omsRuntimeException = omsRuntimeException ;
59+ public void setException (OMSRuntimeException exception ) {
60+ this .exception = exception ;
6061 }
6162}
Original file line number Diff line number Diff line change @@ -38,13 +38,21 @@ public class OMSRuntimeException extends RuntimeException {
3838 *
3939 * @see Error
4040 **/
41- private final int errorCode ;
41+ private int errorCode ;
42+
43+ public OMSRuntimeException () {
44+ }
4245
4346 public OMSRuntimeException (String message ) {
4447 super (message );
4548 this .errorCode = OMSResponseStatus .STATUS_1400 .getStatusCode ();
4649 }
4750
51+ public OMSRuntimeException (Throwable cause ) {
52+ super (cause );
53+ this .errorCode = OMSResponseStatus .STATUS_1400 .getStatusCode ();
54+ }
55+
4856 public OMSRuntimeException (String message , Throwable cause ) {
4957 super (message , cause );
5058 this .errorCode = OMSResponseStatus .STATUS_1400 .getStatusCode ();
You can’t perform that action at this time.
0 commit comments