300.5. 使用示例:
检索 10 个事件
context.addRoutes(new RouteBuilder() { public void configure() { from("direct:servicenow") .to("servicenow:{{env:SERVICENOW_INSTANCE}}" + "?userName={{env:SERVICENOW_USERNAME}}" + "&password={{env:SERVICENOW_PASSWORD}}" + "&oauthClientId={{env:SERVICENOW_OAUTH2_CLIENT_ID}}" + "&oauthClientSecret={{env:SERVICENOW_OAUTH2_CLIENT_SECRET}}" .to("mock:servicenow"); } }); FluentProducerTemplate.on(context) .withHeader(ServiceNowConstants.RESOURCE, "table") .withHeader(ServiceNowConstants.ACTION, ServiceNowConstants.ACTION_RETRIEVE) .withHeader(ServiceNowConstants.SYSPARM_LIMIT.getId(), "10") .withHeader(ServiceNowConstants.TABLE, "incident") .withHeader(ServiceNowConstants.MODEL, Incident.class) .to("direct:servicenow") .send();