Search code examples
sleepmessagebrokeribm-integration-busextended-sql

Message Broker 6.1 sleep exception


I'm trying to add a simple sleep function to extend the base ESQL API.

Java implementation:

public static void sleep(long millis) {
    try {
        Thread.sleep(millis);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

ESQL reference:

CREATE PROCEDURE sleep(IN millis INT)
    LANGUAGE JAVA
    EXTERNAL NAME "com.mypackage.Util.sleep";

This is the error trace:

(0x01000000:Name     ):RecoverableException = (
        (0x03000000:NameValue):File     = '/build/S610_P/src/DataFlowEngine/ImbRdl/ImbRdlExternalJava.cpp' (CHARACTER)
        (0x03000000:NameValue):Line     = 1102 (INTEGER)
        (0x03000000:NameValue):Function = 'ESQL2JavaMethodResolver::decodeReturnStatus' (CHARACTER)
        (0x03000000:NameValue):Type     = '' (CHARACTER)
        (0x03000000:NameValue):Name     = '' (CHARACTER)
        (0x03000000:NameValue):Label    = '' (CHARACTER)
        (0x03000000:NameValue):Catalog  = 'BIPv610' (CHARACTER)
        (0x03000000:NameValue):Severity = 3 (INTEGER)
        (0x03000000:NameValue):Number   = 2946 (INTEGER)
        (0x03000000:NameValue):Text     = 'The Java method could not be found' (CHARACTER)
        (0x01000000:Name     ):Insert   = (
          (0x03000000:NameValue):Type = 5 (INTEGER)
          (0x03000000:NameValue):Text = 'com.mypackage.Util.sleep' (CHARACTER)
        )
      )
    )
  )
)

Solution

  • Solved! For future reference:

    The problem was in the method signature check that wants the wrapper type.
    In this case Long instead of long.

    public static void sleep(Long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }