本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例7: ActiveMQAMQPInvalidContentTypeException
public ActiveMQAMQPInvalidContentTypeException(String message) {
super(AmqpError.INTERNAL_ERROR, message, ActiveMQExceptionType.INTERNAL_ERROR);
}
示例8: ActiveMQAMQPInternalErrorException
public ActiveMQAMQPInternalErrorException(String message, Throwable e) {
super(AmqpError.INTERNAL_ERROR, message, e, ActiveMQExceptionType.INTERNAL_ERROR);
}