当前位置: 首页>>代码示例>>Java>>正文


Java AmqpError.INTERNAL_ERROR属性代码示例

本文整理汇总了Java中org.apache.qpid.proton.amqp.transport.AmqpError.INTERNAL_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java AmqpError.INTERNAL_ERROR属性的具体用法?Java AmqpError.INTERNAL_ERROR怎么用?Java AmqpError.INTERNAL_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.qpid.proton.amqp.transport.AmqpError的用法示例。


在下文中一共展示了AmqpError.INTERNAL_ERROR属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResponse

@Override
public void onResponse(IAmqpProtocolConverter converter, Response response) throws IOException {
    if (response.isException()) {
        sender.setSource(null);
        Throwable exception = ((ExceptionResponse) response).getException();
        Symbol condition = AmqpError.INTERNAL_ERROR;
        if (exception instanceof InvalidSelectorException) {
            condition = AmqpError.INVALID_FIELD;
        }
        sender.setCondition(new ErrorCondition(condition, exception.getMessage()));
        subscriptionsByConsumerId.remove(id);
        sender.close();
    } else {
        sessionContext.consumers.put(id, consumerContext);
        sender.open();
    }
    pumpProtonToSocket();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:18,代码来源:AmqpProtocolConverter.java

示例2: testCreateRedirectionExceptionWithNoNetworkHost

@Test
public void testCreateRedirectionExceptionWithNoNetworkHost() throws URISyntaxException {
    AmqpProvider mockProvider = Mockito.mock(AmqpProvider.class);
    Mockito.when(mockProvider.getRemoteURI()).thenReturn(new URI("amqp://localhost:5672"));

    ErrorCondition condition = new ErrorCondition();

    Map<Symbol, Object> info = new HashMap<>();
    info.put(AmqpSupport.PORT, "5672");
    info.put(AmqpSupport.OPEN_HOSTNAME, "localhost");
    info.put(AmqpSupport.SCHEME, "amqp");
    info.put(AmqpSupport.PATH, "websocket");

    condition.setInfo(info);

    Symbol error = AmqpError.INTERNAL_ERROR;
    String message = "Failed to connect";

    Exception result = AmqpSupport.createRedirectException(mockProvider, error, message, condition);

    assertNotNull(result);
    assertFalse(result instanceof ProviderRedirectedException);
    assertTrue(result instanceof IOException);
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:24,代码来源:AmqpSupportTest.java

示例3: testCreateRedirectionExceptionWithEmptyNetworkHost

@Test
public void testCreateRedirectionExceptionWithEmptyNetworkHost() throws URISyntaxException {
    AmqpProvider mockProvider = Mockito.mock(AmqpProvider.class);
    Mockito.when(mockProvider.getRemoteURI()).thenReturn(new URI("amqp://localhost:5672"));

    ErrorCondition condition = new ErrorCondition();

    Map<Symbol, Object> info = new HashMap<>();
    info.put(AmqpSupport.PORT, "5672");
    info.put(AmqpSupport.NETWORK_HOST, "");
    info.put(AmqpSupport.OPEN_HOSTNAME, "localhost");
    info.put(AmqpSupport.SCHEME, "amqp");
    info.put(AmqpSupport.PATH, "websocket");

    condition.setInfo(info);

    Symbol error = AmqpError.INTERNAL_ERROR;
    String message = "Failed to connect";

    Exception result = AmqpSupport.createRedirectException(mockProvider, error, message, condition);

    assertNotNull(result);
    assertFalse(result instanceof ProviderRedirectedException);
    assertTrue(result instanceof IOException);
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:25,代码来源:AmqpSupportTest.java

示例4: testCreateRedirectionExceptionWithInvalidPort

@Test
public void testCreateRedirectionExceptionWithInvalidPort() throws URISyntaxException {
    AmqpProvider mockProvider = Mockito.mock(AmqpProvider.class);
    Mockito.when(mockProvider.getRemoteURI()).thenReturn(new URI("amqp://localhost:5672"));

    ErrorCondition condition = new ErrorCondition();

    Map<Symbol, Object> info = new HashMap<>();
    info.put(AmqpSupport.PORT, "L5672");
    info.put(AmqpSupport.OPEN_HOSTNAME, "localhost");
    info.put(AmqpSupport.NETWORK_HOST, "localhost");
    info.put(AmqpSupport.SCHEME, "amqp");
    info.put(AmqpSupport.PATH, "websocket");

    condition.setInfo(info);

    Symbol error = AmqpError.INTERNAL_ERROR;
    String message = "Failed to connect";

    Exception result = AmqpSupport.createRedirectException(mockProvider, error, message, condition);

    assertNotNull(result);
    assertFalse(result instanceof ProviderRedirectedException);
    assertTrue(result instanceof IOException);
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:25,代码来源:AmqpSupportTest.java

示例5: testCreateRedirectionException

@Test
public void testCreateRedirectionException() throws URISyntaxException {
    ErrorCondition condition = new ErrorCondition();

    AmqpProvider mockProvider = Mockito.mock(AmqpProvider.class);
    Mockito.when(mockProvider.getRemoteURI()).thenReturn(new URI("amqp://localhost:5672"));

    Map<Symbol, Object> info = new HashMap<>();
    info.put(AmqpSupport.PORT, "5672");
    info.put(AmqpSupport.OPEN_HOSTNAME, "localhost.localdomain");
    info.put(AmqpSupport.NETWORK_HOST, "localhost");
    info.put(AmqpSupport.SCHEME, "amqp");
    info.put(AmqpSupport.PATH, "/websocket");

    condition.setInfo(info);

    Symbol error = AmqpError.INTERNAL_ERROR;
    String message = "Failed to connect";

    Exception result = AmqpSupport.createRedirectException(mockProvider, error, message, condition);

    assertNotNull(result);
    assertTrue(result instanceof ProviderRedirectedException);

    ProviderRedirectedException pre = (ProviderRedirectedException) result;

    URI redirection = pre.getRedirectionURI();

    assertEquals(5672, redirection.getPort());
    assertTrue("localhost.localdomain", redirection.getQuery().contains("amqp.vhost=localhost.localdomain"));
    assertEquals("localhost", redirection.getHost());
    assertEquals("amqp", redirection.getScheme());
    assertEquals("/websocket", redirection.getPath());
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:34,代码来源:AmqpSupportTest.java

示例6: testCreateRedirectionExceptionWithNoRedirectInfo

@Test
public void testCreateRedirectionExceptionWithNoRedirectInfo() throws URISyntaxException {
    AmqpProvider mockProvider = Mockito.mock(AmqpProvider.class);
    Mockito.when(mockProvider.getRemoteURI()).thenReturn(new URI("amqp://localhost:5672"));

    ErrorCondition condition = new ErrorCondition();
    Symbol error = AmqpError.INTERNAL_ERROR;
    String message = "Failed to connect";

    Exception result = AmqpSupport.createRedirectException(mockProvider, error, message, condition);

    assertNotNull(result);
    assertFalse(result instanceof ProviderRedirectedException);
    assertTrue(result instanceof IOException);
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:15,代码来源:AmqpSupportTest.java

示例7: ActiveMQAMQPInvalidContentTypeException

public ActiveMQAMQPInvalidContentTypeException(String message) {
   super(AmqpError.INTERNAL_ERROR, message, ActiveMQExceptionType.INTERNAL_ERROR);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:3,代码来源:ActiveMQAMQPInvalidContentTypeException.java

示例8: ActiveMQAMQPInternalErrorException

public ActiveMQAMQPInternalErrorException(String message, Throwable e) {
   super(AmqpError.INTERNAL_ERROR, message, e, ActiveMQExceptionType.INTERNAL_ERROR);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:3,代码来源:ActiveMQAMQPInternalErrorException.java


注:本文中的org.apache.qpid.proton.amqp.transport.AmqpError.INTERNAL_ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。