- Q: What is the relationship between ServiceComb and SpringCloud, and what is ServiceComb specific application scenarios?
A: ServiceComb is a set of microservice development frameworks based on large-scale IT system practices. It encapsulates a set of microservices running models based on best practices in development. These capabilities are completely transparent to users,it can be integrated and adjusted by configuration. In the operation and maintenance phase, microservices operation and maintenance have been fully considered, providing rich monitoring indicators and dynamic governance capabilities. B: ServiceComb's capabilities can be used as a separate development framework, in a scenario that requires a lightweight microservice solution, or on SpringCloud, working with other components provided by SpringCloud, in heavyweight The scene together with SpringCloud produces a '1+1>2' effect.
-
Q: Do we have a problem with IntelliJ's free version? A: No problem, use IntelliJ development, refer to [Setup Developer Environment] (/cn/developers/setup-develop-environment/) for the corresponding environment configuration.
-
Q: What need to be cautious when using Java-Chassis?
A: There are a few restrictions when using Java-Chassis:
* Before version 0.3.0-SNAPSHOT, it does not support annotations like @GetMapping
.
* When using the same HTTP request method, e.g. GET, the method name need to be unique as it will become operation ID when swagger generates contracts.
* Class and method name need to be public.
- Q: Contract generation will report error: 'Caused by: java.lang.Error: OperationId must be unique', does not support function overriding?
A: We support function overriding, plus the @ApiOperation
tag. There are examples in demo-pojo. Each interface must have a unique operation id.
- Q: When using the spring-boot-starter-provider dependency, property like
spring.main.web-environment
not working in application.yml file.
A: When you need both the starter provider dependency and the servlet, you need to declare spring.main.web-environment
in application.properties file or declare it in application.yml file and create an empty application.properties file.
- Q: What's the dependency differences between gateway and other microservices?
xml
<groupId>org.apache.servicecomb</groupId>
<artifactId>spring-boot-starter-provider</artifactId>
A: Gateway depends on not only the spring-boot-starter-provider
, but also the spring-boot-starter-discovery
. This can refer to the manger implementation of LinuxCon-Beijing-Workshop.
- Q: Do gateway need to configure assembly like the other microservices? Is /maven/gateway the default path of the docker maven plugin?
A: Yes. Docker maven plugin relies on the assembly files to generate docker image. /maven is the default path of docker maven plugin and /gateway is the path defined in the assembly file.
- Q: Are there any restrictions of the return type of our API? Should it be the type of ResponseEntity?
A: No, examples can refer to the implementation of integration-test in java-chassis.
- Q: After the microservice is started, the interface cannot be called correctly, or is there no error returned?
A: Please check that the calling path is exactly the same as the path published in the Producer implementation code. The boot log on the Producer side can see the output of the map path, for example:
[INFO] Swagger mapped "{[/hello/], method=[GET], produces=[application/json]}"
For different programming styles (models) to implement Producer documentation and notes, please see: Jaxrs SpringMVC Pojo Spring Boot .
10. Q: The port number under the microservice.yaml configuration file has been modified via eclipse. After starting the program, the port number does not work?
A: You need to import the sample project alone. If you import the entire ServiceComb-Java-Chassis project, the IDE will not compile the sample because the sample directory is not in the ServiceComb-Java-Chassis module. There is no error message under eclipse. Prompt message. Therefore, eclipse starts the demo of the sample and will find that the modified port does not work. 12. Q: How do I customize the HTTP status code in the REST interface for a Java method?
A: For normal return values, you can do this with SwaggerAnnotation, for example:
java
@ApiResponse(code = 300, response = String.class, message = "")
public int test(int x) {
return 100;
}
For the return value of the exception, you can do this by throwing a custom InvocationException, for example:
```java public String testException(int code) { String strCode = String.valueOf(code); switch (code) { case 200: return strCode; case 456: throw new InvocationException(code, strCode, strCode + " error"); case 556: throw new InvocationException(code, strCode, Arrays.asList(strCode + " error")); case 557: throw new InvocationException(code, strCode, Arrays.asList(Arrays.asList(strCode + " error"))); default: break; }
return "not expected";
} ```
- Q: How to customize the log configuration of your own microservice?
A: ServiceComb does not bind the logger, just uses slf4j, users can freely choose log4j/log4j2/logback and so on. ServiceComb provides a log4j extension that supports incremental configuration of log4j's properties files on a standard log4j basis.
* By default, the configuration file is loaded by the rule: "classpath*:config/log4j.properties"
* Actually search all the config/log4j.properties and config/log4j.*.properties
in the classpath, and cut out the \*
from the searched file to perform alpha. Sort, then load in order, and the final synthesized file is used as the log4j configuration file.
* If you want to use ServiceComb's log4j extension, you need to call Log4jUtils.init, otherwise it will be used according to the rules of the standard logger.
- Q: When the service is configured with multiple transports, how do you choose which transport to use at runtime?
A: * ServiceComb's consumer, transport, handler, and producer are decoupled, and each function works together through contract definitions, namely: Consumer use transparent rpc, or springmvc development and use of highway, or RESTful transmission on the network does not matter with the producer is to use transparent rpc, or jaxrs, or springmvc development, there is no relationship between the receiver is not perceived, business development methods and transmission methods
* Consumer access to the producer, at the runtime's transport selection, the general rule is: The consumer's transport and the producer's endpoint take the intersection. If there are multiple transports after the intersection, they are used in turn.
Decomposed, there are the following scenarios:
* When a microservice producer opens both the highway and the RESTful endpoint * Only the highway transport jar is deployed in the consumer process, only the producer's highway endpoint is accessed. * Only the RESTful transport jar is deployed in the consumer process, only the RESTful endpoint of the producer is accessed. * In the consumer process, both the highway and RESTful transport jars are deployed, and the producer's highway and RESTful endpoints are accessed in turn.
If, at this time, the consumer wants to use a transport to access the producer, it can be configured in the microservice.yaml of the consumer process, specifying the name of the transport:
yaml
Servicecomb:
References:
<service_name>:
Transport: highway
* When a microservice producer only opens the endpoint of the highway * The consumer process only deploys the highway transport jar, then the highway access is normally used. *The consumer process only deploys RESTful transport jars and cannot be accessed * The consumer process deploys both the highway and the RESTful transport jar, and the highway access is normally used.
* When a microservice producer only opens RESTful endpoints *The consumer process only deploys the highway transport jar and cannot access it. * The consumer process only deploys RESTful transport jars, which normally uses RESTful access. * The consumer process deploys both the highway and the RESTful transport jar, and the RESTful access is normally used.
- Q: The swagger body parameter type is incorrectly defined, causing the content registered in the service center to have no type information
Symptom:
Define the following interface, put the parameters into the body to pass
yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "xxxxx"
Required: false
Type: string
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"
Define the interface in the above way. After the service is registered, the interface type: string that is queried from the service center is lost and becomes:
yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "xxxxx"
Required: false
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"
If the client does not place a swagger, the following exception is also reported:
text
Caused by: java.lang.ClassFormatError: Method "testInherate" in class ? has illegal signature "
A: When defining the type of the body parameter, you need to use the schema. You cannot use type directly.
yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "request"
Required: false
Schema:
Type: string
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"
- Q: Does the ServiceComb microservices framework service innovate via long connection?
A: http request via a long connection (with a timeout), and the highway mode also via a long connection (all the time).
- Q: Is the service disconnected service center registration information automatically deleted?
A: The service center heartbeat detects that the service instance is unavailable, only the service instance information is removed, and the static data of the service is not removed.
- Q: How to implement service registration if you use the tomcat method to integrate the ServiceComb microservices framework
A: If you use the ServiceComb sdk servlet method (using the transport-rest-servlet dependency) to deploy to the tomcat as a war package, you need to ensure that the rest port configuration in the service description file (microservice.yaml) is consistent with the external container to implement the service. Register correctly. Otherwise, the tomcat open port cannot be perceived.
- Q: If you use the tomcat method to integrate the ServiceComb microservices framework, how to register the context of the war package deployment to the service center when the service is registered
A: When publishing the service interface, you need to put the context of the war package deployment at the front of the baseurl, so that the path registered to the service center is the complete path (including the context). Example:
java
@path(/{context}/xxx)
Class ServiceA
- Q: How does the ServiceComb microservices framework implement data transparent transmission between multiple microservices
A: Transmitting data into:
java
CseHttpEntity<xxxx.class> httpEntity = new CseHttpEntity<>(xxx);
/ / Transparent content
httpEntity.addContext("contextKey","contextValue");
ResponseEntity<String> responseEntity = RestTemplateBuilder.create().exchange("cse://springmvc/springmvchello/sayhello",HttpMethod.POST, httpEntity, String.class);
Transparent data acquisition:
java
@Override
@RequestMapping(path="/sayhello",method = RequestMethod.POST)
Public String sayHello(@RequestBody Person person, InvocationContext context){
/ / Transparent data acquisition
context.getContext();
Return "Hello person " + person.getName();
}
- Q: How does the ServiceComb microservices framework service customize the return status code?
A:
java
@Override
@RequestMapping(path = "/sayhello",method = RequestMethod.POST)
Public String sayHello(@RequestBody Person person){
InvocationContext context = ContextUtils.getInvocationContext();
/ / Custom status code
context.setStatus(Status.CREATED);
Return "Hello person "+person.getName();
}
- Q: Partial exposure of ServiceComb body Model
A: There may be some attributes in the body object corresponding to an interface. You don't want to open it. Do not bring it out when generating the schema. Use:
java
@ApiModelProperty(hidden = true)
- Q: ServiceComb framework gets the address of the remote consumer
A: If you use the http rest method (using the transport-rest-vertx dependency) you can get it in the following way:
java
AbstractProducerContextArgMapper httpRequestCreator = (AbstractProducerContextArgMapper)invocation.getHandlerContext().get(RestConst.HTTP_REQUEST_CREATOR);
If(httpRequestCreator != null){
HttpServletRequest req = (HttpServletRequest)httpRequestCreator.createContextArg(invocation);
System.out.println(req.getRemoteHost());
}
The actual scenario is to take the outermost address, so LB should be passed to edgeservice, and edgeService should be passed outside the context.
- Q: ServiceComb describes the handler
A: The consumer default handler is simpleLB. When there is no configuration, the handler chain will use this. If the handler is configured, it must contain the lb handler. Otherwise, the call error is reported in the document.
- Q: ServiceComb log replacement
A: CSE java-chassis log recommendation method is to use Log4jUtils.init() at startup, directly use the recommended Log4j for log management, but some scenarios do not want to use log4j, such as want to use log4j2 or logback, below log4j2 Take a brief introduction to the next step:
1. Do not use Log4jUtils.init() in the code;
2. Remove the log4j configuration file (it doesn't matter if you don't delete it, because it won't be used);
3. Exclude the log4j introduced by the CSE framework, for example:
xml
<dependency>
<groupId>org.apache.servicecomb</groupId>
<artifactId>provider-springmvc</artifactId>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
4. Introducing the dependency of log4j2
xml
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
If there is no version dependency management, you need to fill in the version number.
5. Add the log4j2 configuration file log4j2.xml. Please check the official description for this, for example:
xml
<?xml version="1.0" encoding="UTF-8"?>
<!--Log level and priority ordering: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
<!--Configuration behind the configuration, this is used to set the internal information output of log4j2, can not be set, when set to trace, you will see various detailed output inside log4j2 -->
<!--monitorInterval: Log4j can automatically detect the modified configuration file and reconfigure itself, set the interval seconds -->
<configuration status="WARN" monitorInterval="30">
<!--First define all appender-->
<appenders>
<!--This output console configuration -->
<console name="Console" target="SYSTEM_OUT">
<!--Format of output log -->
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
</console>
<!--The file will print out all the information, this log will be automatically cleared every time the program is run, determined by the append attribute, this is also very useful, suitable for temporary testing -->
<File name="log" fileName="log/test.log" append="false">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
</File>
<!-- This will print out all info and the following level information. Each time the size exceeds the size, the size of the log will be automatically saved under the folder created by the year-month and compressed, as an archive -->
<RollingFile name="RollingFileInfo" fileName="${sys:user.home}/logs/info.log"
filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log">
<!--The console only outputs level and above information (onMatch), other direct rejection (onMismatch) -->
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
</RollingFile>
<RollingFile name="RollingFileWarn" fileName="${sys:user.home}/logs/warn.log"
filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log">
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
<!-- DefaultRolloverStrategy property is not set, the default is up to 7 files in the same folder, here set 20 -->
<DefaultRolloverStrategy max="20"/>
</RollingFile>
<RollingFile name="RollingFileError" fileName="${sys:user.home}/logs/error.log"
filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
</RollingFile>
</appenders>
<!-- Then define the logger, the appender will only take effect if the appender is defined and imported ->
<loggers>
<!--Filter out some useless DEBUG information from spring and mybatis -->
<logger name="org.springframework" level="INFO"></logger>
<logger name="org.mybatis" level="INFO"></logger>
<root level="all">
<appender-ref ref="Console"/>
<appender-ref ref="RollingFileInfo"/>
<appender-ref ref="RollingFileWarn"/>
<appender-ref ref="RollingFileError"/>
</root>
</loggers>
</configuration>
6. Start the service for verification
- Q: Service timeout setting
A: Add the following configuration to the microservice description file (microservice.yaml):
yaml
servicecomb:
request:
timeout: 30000
- Q: The URL address can be uniquely located. Why do you want to add a schema?
A: 1. The schema is used to match the service contract. It is used to ensure that the server and the consumer contract are compatible. Each contract needs a unique ID and is stored in the service center. 2. Schema maps to the interface concept of java. When the consumer uses the transparent rpc mode to develop, it can find which operation in the micro service. The method names between schemas are not unique. 3. operation qualified name is the key of the governance, and the URL cannot be directly searched because of the existence of the path parameter, and the qualified name will not change. Governance does not distinguish between transmissions. If governance goes by URL, then when highway is called in, it has to construct the url according to the parameters, and then the regular expression matches, which is too tossing. 4. http is just a transport channel, and there are other transport channels that do not need to be mapped to URLs.
- Q: When the Rest client is invocating, it only takes the service name and URL, and does not need to specify the schema id. In fact, according to this URL, the specific contract can also be found. So what is the role of the specified schema id?
A: Since transparent rpc is an interface call and does not have a URL, the internal is actually normalized to the operation to describe, so that it can be uniquely mapped to the specific request processing in conjunction with the schema id.
- Q: What is the concept of Transport? What is it used for?
A: The Transport is responsible for codec, and transmission. The communication model has two kinds of Rest and Highway. The Highway corresponds to the private protocol, which uses protobuf encoding, and the Rest uses json. Highway and Rest are based on vertx, and vertx is based on netty.
- Q: Is there be multiple appIDs and microservices in a service provider? What scenario will this happen?
A: Yes, what is expressed here is a concept of merge. The microservice.yaml file, which may exist in both jars, disks, and command line arguments, specifies that they are merged by priority and are used for added flexibility. In the jar is the default value, in addition to the environment variables, command line parameters, configuration center coverage, providing multiple layers of customization.
- Q: How does ServiceComb interact with the service center?
A: Take the rest, mainly responsible for registration, taking data and heartbeat, etc.; 'watch event' via websocket, watch event is to observe whether the service center instance information has changed.
- Q: Is there a governance center like dubbo?
A: bizkeeper is a handler, one of the contents of governance. Governance can be extended by handlers.
- Q: How to understand the service path?
A: Each microservice has a servicePathManager, and each schema registers its own path.
- Q: Can the browser directly access the microservice Endpoint?
A: Yes, the restful microservice Endpoint can be used to access the service that provides the get method directly in the browser using HTTP plus service path. If it is to access the services provided by other Http methods, it is recommended to install and use.(https://www.sap.com/developer/tutorials/api-tools-postman-install.html)
- Q: When the contract is generated, do you have to add the version number and language?
A: The contract belongs to the microservice. The microservice has a version, but the language should not be accompanied by the version number. Contractual requirements should be independent of language. The contract "no version", the version of the contract is embodied in the microservice, the instance can find the version of the microservice to which it belongs, and a certain contract can be found.
- Q: The design code in ServiceRegistry is similar to Eureka?
A: Our first version was built on the basis of Spring Cloud. Later, when we found that it was not enough to use it, we gradually made our own set, so it was designed after fully referring to Eureka.
- Q: Some rpc is netty calling redis implementation, what is the advantage over direct netty forwarding?
A: Maybe I want to use Redis to solve the subscription release. But this is not a big deal. I tried it before, but later I changed it to ServiceComb.
- Q: If you introduce the
transport-rest-servlet
andtransport-rest-vertx
dependencies at the same time, how does it decide which one to use?
A: If the port is not occupied, use vertx; if it is occupied, use servlet.
- Q: What is the scenario for qps flow control design?
A: Rate limit has two main functions. First, it guarantees the service effect to some key services by restricting different consumers, and the second is to prevent the avalanche effect. The thickness of the water pipe can be determined according to the importance of the service. ServiceComb supports two types of current limiting methods, namely, consumer-side current limiting and server-side current limiting. The consumer-side current limiting can achieve relatively fine control.
- Q: If the server is a chain call, that is, a->b->c, then does the QPS flow control cause flow pipe uneven and unbalanced?
A: The general mode is to measure and then set. The qps settings are ultimately tuned in conjunction with the overall business needs, rather than setting them up on a single node.
- Q: The service failed to be invoked via cse://serviceName/appPath, error: java.lang.Error:not support def type:class io.swagger.models.properties xxx
A: Check whether the version of java-chassis that the consumer and provider depend on are consistent. If they are inconsistent, please modify and use the newer version.
- Q: When sending a rest request, the following error is reported: Bad Request, description: http:request body too large
A: Check if the Service Center is older version, and if so, upgrade to the latest version.
- Q: How to ignore the attributes specified in the contract DTO?
A: If you are using 'rest transport', because it is Json serialization, you can use @JsonIgnore annotations to mark attributes that need to be ignored; 'highway transport' is not currently supported. Note that you need to update the version of the microservice after the modification, for example:
java
public class OutputForTest{
@JsonIgnore
private String outputId = null;
private String inputId = null;
...
}
- Q: How to get the value of a field in the header in a user-defined handler
A: Use the @ApiImplicitParams annotation declaration in the user-defined handler and the invocation.getArgs() to get the value of the header. E.g:
java public class MyHandler implements Handler { @ApiImplicitParams({@ApiImplicitParam(name = "tester", dataType = "string", paramType = "header")}) @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Object[] args = invocation.getArgs(); System.out.println(args); } }
- Q: The exception is thrown when the microservices runtime:
java.lang.Error:not support def type:calss io.swagger.models.properties BaseIntegerProperty
?
A: Service Center can be upgraded to version 4.0.0+ to solve [Service Center latest version portal] (http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center /1.0.0-m1/).
. Q: Our API can not be accessed after microservices are up. It just returns 404 Not Found. The codes we use is as follows:*
java
@RestController
@RestSchema(schemaId = "worker")
public class WorkerController {
@RequestMapping(value="/count", method=RequestMethod.GET)
public int getWorkerNumbers() {
...
}
}
A: Without specifying the base path, ServiceComb will use the classname as the base path. Hence, the path should be /WorkerController/count
in the previous code. If you want to access path like /count
, you need to specify base path as /
as follows:
java
@RequestMapping(value = "/")
public class WorkerController {}
. Q: What\'s the default base path if I have not declared the value of RequestMapping annotation?*
A: Supposed the class name of your controller is HelloController, the base path is /HelloController.


public class TableFormat
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
TableFormat.Format
A static inner class that consists of two fields.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.List<TableFormat.Format> |
patterns |
| Constructor and Description |
|---|
TableFormat() |
| Modifier and Type | Method and Description |
|---|---|
TableFormat |
addEntryPattern(int index,
java.lang.String entryPattern)
Add a pattern to a particular column of the table representing how the entry
in that column is split
|
TableFormat |
addFormat(java.lang.String[] format)
Adding a list of string which represents how each column in the table is split.
|
(package private) static TableFormat |
buildFromJSON(org.json.JSONObject input)
Build a text file from JSON document.
|
(package private) java.util.Map<java.lang.String,java.lang.Integer> |
parseColumns(java.lang.String input)
Get a list of column and index mapping pairs from the first line of the text file
|
(package private) java.util.HashSet<java.lang.String> |
parseEntry(java.lang.String input,
int index)
parse an entry with multiple value split by a given pattern
|
(package private) java.util.ArrayList<java.lang.String> |
parseLine(java.lang.String input)
Split the line of text into an ArrayList of string, using the specified format
specified by the user
|
final java.util.List<TableFormat.Format> patterns
static TableFormat buildFromJSON(org.json.JSONObject input)
input
- an instance of JSONObject representing the fields of the
Table Format classjava.lang.IllegalArgumentException
- when the list of string representing how columns should be split is empty
or when the size of the entryFormat list does not match with the number of column (1 more than the number of
formatColumn)public TableFormat addFormat(java.lang.String[] format)
format
- a list of string represents how each columns is split
For example: a$a#a*a is split by $, #,*, so format should
be equals to ["$","#","*]java.lang.IllegalArgumentException
- if the size of format is less than 1, or addFormat has been called oncepublic TableFormat addEntryPattern(int index, java.lang.String entryPattern)
index
- the (index)th column in the order of String[] format that was used
when calling addFormatentryPattern
- how the entry is split, for instance, for a column with entry
like "a, b, c, c", entryPattern should be equals to ", "java.util.HashSet<java.lang.String> parseEntry(java.lang.String input, int index)
input
- the entriesindex
- the column index in the order how the columns are addedjava.lang.IllegalStateException
- if this method was called before addFormat has been calledjava.lang.IllegalArgumentException
- if index is out of bound (greater or equals to the number of columns)java.util.ArrayList<java.lang.String> parseLine(java.lang.String input)
input
- the line of string we want to splitjava.lang.IllegalStateException
- if this method was called before addFormat has been calledjava.util.Map<java.lang.String,java.lang.Integer> parseColumns(java.lang.String input)
Example:
input = "col1 col2 col3 col4"
returns {"col1" : 0, "col2" : 1, "col2" : 2, "col2" : 3}
input
- the first line of the text file (which usually consists of column name)java.lang.IllegalStateException
- if this method was called before addFormat has been called


You have some unpublished changes. Click the Publish Changes button to make the changes visible to everyone.


Thank you for your participation! The experiment is almost over. After answering the questions on this page, you will receive your completion code on the next page.
| Are you a native speaker of English? | |
| Were most images easy to name? | |
| Any other comments? | |


→
EVENTS
Ready to join the movement? Check out what's happening soon in your area.
Explore community events near you, request your own!


In AWS we have several ways to deploy Django (and not Django applications) with Docker. We can use ECS or EKS clusters. If we don’t have one ECS or Kubernetes cluster up and running, maybe it can be complex. Today I want to show how deploy a Django application in production mode within a EC2 host. Let’s start.
I’m getting older to provision one host by hand I prefer to use docker. The idea is create one EC2 instance (one simple Amazon Linux AMI AWS-supported image). This host don’t have docker installed. We need to install it. When we launch one instance, when we’re configuring the instance, we can specify user data to configure an instance or run a configuration script during launch.
We only need to put this shell script to set up docker
yum update -y
yum install -y docker
usermod -a -G docker ec2-user
curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-\`uname -s\`-\`uname -m\` | sudo tee /usr/local/bin/docker-compose > /dev/null
chmod +x /usr/local/bin/docker-compose
service docker start
chkconfig docker on
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Madrid /etc/localtime
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker swarm init
We also need to attach one IAM role to our instance. This IAM role only need to allow us the following policies:
- AmazonEC2ContainerRegistryReadOnly (because we’re going to use AWS ECR as container registry)
- CloudWatchAgentServerPolicy (because we’re going to emit our logs to Cloudwatch)
Also we need to set up a security group to allow incoming SSH connections to port 22 and HTTP connections (in our example to port 8000)
When we launch our instance we need to provide a keypair to connect via ssh. I like to put this keypair in my .ssh/config
Host xxx.eu-central-1.compute.amazonaws.com User ec2-user Identityfile ~/.ssh/keypair-xxx.pem
To deploy our application we need to follow those steps:
- Build our docker images
- Push our images to a container registry (in this case ECR)
- Deploy the application.
I’ve created a simple shell script called deploy.sh to perform all tasks:
#!/usr/bin/env bash
set -a
\[ -f deploy.env \] && . deploy.env
set +a
echo "$(tput setaf 1)Building docker images ...$(tput sgr0)"
docker build -t ec2-web -t ec2-web:latest -t $ECR/ec2-web:latest .
docker build -t ec2-nginx -t $ECR/ec2-nginx:latest .docker/nginx
echo "$(tput setaf 1)Pusing to ECR ...$(tput sgr0)"
aws ecr get-login-password --region $REGION --profile $PROFILE |
docker login --username AWS --password-stdin $ECR
docker push $ECR/ec2-web:latest
docker push $ECR/ec2-nginx:latest
CMD="docker stack deploy -c $DOCKER\_COMPOSE\_YML ec2 --with-registry-auth"
echo "$(tput setaf 1)Deploying to EC2 ($CMD)...$(tput sgr0)"
echo "$CMD"
DOCKER\_HOST="ssh://$HOST" $CMD
echo "$(tput setaf 1)Building finished $(date +'%Y%m%d.%H%M%S')$(tput sgr0)"
This script assumes that there’s a deploy.env file with our personal configuration (AWS profile, the host of the EC2, instance, The ECR and things like that)
PROFILE=xxxxxxx
DOKER\_COMPOSE\_YML=docker-compose.yml
<EMAIL_ADDRESS>ECR=9999999999.dkr.ecr.eu-central-1.amazonaws.com
REGION=eu-central-1
In this example I’m using docker swarm to deploy the application. I want to play also with secrets. This dummy application don’t have any sensitive information but I’ve created one “ec2.supersecret” variable
echo "super secret text" | docker secret create ec2.supersecret -
That’s the docker-compose.yml file:
version: '3.8'
services:
web:
image: 999999999.dkr.ecr.eu-central-1.amazonaws.com/ec2-web:latest
command: /bin/bash ./docker-entrypoint.sh
environment:
DEBUG: 'False'
secrets:
- ec2.supersecret
deploy:
replicas: 1
logging:
driver: awslogs
options:
awslogs-group: /projects/ec2
awslogs-region: eu-central-1
awslogs-stream: app
volumes:
- static_volume:/src/staticfiles
nginx:
image: 99999999.dkr.ecr.eu-central-1.amazonaws.com/ec2-nginx:latest
deploy:
replicas: 1
logging:
driver: awslogs
options:
awslogs-group: /projects/ec2
awslogs-region: eu-central-1
awslogs-stream: nginx
volumes:
- static_volume:/src/staticfiles:ro
ports:
- 8000:80
depends_on:
- web
volumes:
static_volume:
secrets:
ec2.supersecret:
external: true
And that’s all. Maybe ECS or EKS are better solutions to deploy docker applications in AWS, but we also can deploy easily to one docker host in a EC2 instance that it can be ready within a couple of minutes.
Source code in my github


Where to go for a festive afternoon tea in Nottingham this Christmas
Get in the festive mood with turkey sandwiches, cinnamon scones and popping candy snowballs
by Lynette PinchessBest frocks, vintage china, dainty sandwiches and exquisite little cakes aren't just for summer-time afternoon tea.
Cafes, restaurants and the spiritual home of Batman are giving the quintessential British tradition a festive makeover.
Instead of a roast turkey dinner with all the trimmings, it's an alternative way of spending quality time catching up with friends and family over a cup of tea or cheeky glass of prosecco and a delicious array of sandwiches, big fluffy scones and decadent cakes.
Make a date with these Notts cafes and restaurants which will be bringing tiers of festive joy.
The Pudding Pantry
Put some sparkle into your Christmas celebrations at the masters of sweet treats.
Always popular and likely to book up quickly, the Pudding Pantry cafes in the city and Sherwood are kicking the festivities off on November 29 with a selection of seasonal sandwiches, festive petit fours and orange and cranberry scones.
In addition to tea, customers can have a tipple - choose from bubbles, mulled wine or mulled cider.
Price: £16.95 per person or £21.95 with prosecco, etc
Location: Trinity Square, Burton Street, Nottingham NG1 4AF and 579, Mansfield Road, Sherwood NG5 2JN
Booking: Go to thepuddingpantry/afternoon-tea
Colwick Hall
Famed for its themed afternoon teas, the December spread takes inspiration from Charles Dickens' A Christmas Carol.
However, there's nothing 'bah humbug' about this delicious menu of Scrooge Sandwiches, Fezziwigs Fanciful Delights and Desserts of Christmas Past, Present and Future.
Chefs will be conjuring up Cratchit’s cucumber and cranberry cream cheese sandwiches, Mrs Cratchit’s beef pocket pie and sweet treats of cranberry and orange scones with a clementine curd and cinnamon clotted cream and Figgy pudding truffle.
And sitting by a cosy fire, what could be more Christmassy?
Price: £26.95 per person on Saturday and Sunday, with a weekday offer of £39 for two, Monday to Friday. Groups of 10+ will also benefit from ten per cent off. Children under 11, £13.50 each.
Location: Racecourse Road, Colwick NG2 4BH
Booking: 0115 950 0566 or<EMAIL_ADDRESS>Hart's Kitchen
Afternoon tea at one of Nottingham's premier hotels will be given a festive twist during December. The two AA Rosette hotel restaurant will be serving a selection of dainty sandwiches with fillings such as French Brie and cranberry and roast Derbyshire beef and creamed horseradish.
Freshly-baked sweet treats, including mince pies, will follow, all washed down with a choice of Jing teas.
The Yuletide tea will be served Monday to Friday, from noon to 5pm, and Saturdays 2-5pm.
Price: £21.95 per person.
Location: Standard Hill, Park Row, Nottingham NG1 6GN
To book: Pre-booking is essential, 0115 988 1900.
Fables Coffee House
You'd be crackers to pass up this seasonal tea treat at the cosy cafe which used to be the village library in Edwinstowe.
The festive feast comes with a choice of sandwiches, soup, a savoury tart, freshly baked scones with jam or mincemeat, mince pies and chocolate goodies.
As well as hot drinks, mulled wine and prosecco will be served. As part of the war against plastic, the crackers are eco-friendly. They contain a paper hat but rather than a plastic toy, a donation will be made to homelessness charity Shelter, and everything is compostable.
Price: £45 for two.
Location: High Street, Edwinstowe NG21 9QS
To book: Booking in advance isn't essential but to reserve a table contact 01623 822881.
Tiffin Tea House
Celebrating eight years in business this December, the vintage tea house in West Bridgford will launch its Christmas afternoon tea on Friday, November 29.
On the menu will be sandwiches with home-cooked gammon, smoked salmon, and chicken with stuffing and cranberry sauce.
Classic cakes like Victoria sponge and coffee and walnut will be served with mini mince pies and chocolate and amaretto battenberg. Completing the feast will be fruit scones with clotted cream and jam.
Gluten-free and vegan versions will be available.
It comes with a vintage china pot of your favourite loose leaf tea or add a touch of winter spice with Ceylon cinnamon black tea or Kuchipudi Masala Chai.
Price: £14.95 per person, or £19.95 with prosecco.
Location: Abbey Road, West Bridgford NG2 5NG
Booking: Recommended but not necessary (unless a party of four or more). Telephone 0115 981 6224.
Wollaton Hall
Wayne Manor, where scenes from the Batman movie The Dark Knight Rises, provides the perfect festive backdrop for a sumptuous Christmas afternoon tea with savoury and sweet treats served on vintage china.
Take a regular afternoon tea or treat yourself to a sparkling afternoon tea with gin, prosecco or a glass of wine.
Available every weekend from Sunday, December 1 until Sunday, December 22 with slots from 11am to 3.30pm. Complete the outing with a walk around the deer park.
Price: £15 per person, sparking £20, and children, 3 to 15, £7.50
Location: Wollaton Road, Wollaton NG8 2AE
Booking: Book in advance by calling 0115 876 1057.
Tom Browns Brasserie
Have yourself a merry little Christmas at the award-winning restaurant in Gunthorpe with tea served with aplomb by the team who scooped the accolade for Outstanding Service award at the NottinghamshireLive Food and Drink Awards.
Think popping candy coconut snowballs, Christmas pudding brownies, cinnamon scones with cranberry jam and lots of other festive surprises.
Served every day, except Sunday, there will be the added bonus of live music from pianist and singer Craig Baumber on Saturdays.
Starting on November 30, Christmas themed tea will be served until December 21.
Price: Saturdays £25 per person and midweek £20 per person.
Location: Trentside, Gunthorpe NG14 7FB
To book: Booking is essential. Call 0115 966 3642.
Madhatters Tea Room
The Alice in Wonderland themed tea room will be celebrating the most wonderful time of the year with an afternoon tea full of festive flavours.
Customers will be able to tuck into savoury canapés, finger sandwiches, scones with jam and clotted cream and festive sweet treats.
The contents will vary daily and can be tailored to cater for dietary requirements. As well as tea and coffee in abundance the tea room is licensed, so a cheeky glass of fizz will get the Christmas celebrations off on the right note.
Price: £18.95 per person.
Location: James Street, Kimberley NG16 2LP
To book: Telephone 0115 938 3255.


Main interface for consumer
Usage: Once ConsumerFetcherManager is created, startConnections() and stopAllConnections() can be called repeatedly until shutdown() is called.
An iterator that blocks until a value can be read from the supplied queue.
Tracks metrics for each topic the given consumer client has consumed data from.
Tracks metrics of the requests made by a given consumer client to all brokers, and the responses obtained from the brokers.
Range partitioning works on a per-topic basis.
The round-robin partition assignor lays out all the available partitions and all the available consumer threads.
A consumer of kafka messages
Stores the topic stats information of each consumer client in a (clientId -> ConsumerTopicStats) map.
Stores the fetch request and response stats information of each consumer client in a (clientId -> FetchRequestAndResponseStats) map.


CrimPapers
Articles published on 1 May 2019
On 1 May 2019, 7 new articles were published in 7 journals.
Making A Difference - Or Not: An Evaluation of the Effects of Failing to Evaluate
Youthful Parricide: Child Abuse Is Not the Primary Motivator (invited Paper)
Understanding the Landscape of Substance Use Management Practices in Domestic Violence Shelters Across Ontario
An Analysis of Self-Reported Suicide Attempts and Ideation in A National Sample of Incarcerated Individuals Convicted of Sexual Crimes by Kseniya Katsman, Elizabeth L. Jeglic
Confidence in the Police Among Immigrants in South Korea
Philip Damien Cummins; 9 November 1939–24 February 2019 by Ian Freckelton
Symbolically Annihilating Female Police Officer Capabilities: Cultivating Gendered Police Use of Force Expectations? by Franklin T. Wilson, Brian P. Schaefer, Ashley G. Blackburn, Howard Henderson


Ipanema VIBE is a new, exciting and innovative printed, digital and application magazine, all in English, created to inform foreign visitors to Rio about everything that is “Ipanema,” has to offer.
Ipanema VIBE magazine will have 40 glossy high quality pages, intelligent and creative contents, interviews and other interesting subjects to feed the expectations of all kinds of readers.
Ipanema VIBE will raise businesses in the area to international standards and provoke very positive changes.
It`s 0 Edition will be launched just before Rio carnival 2017. There will be free 10.000 copies distributed complimentary and available at the most influential establishments in Ipanema.
Our aim is to raise the profile and excellence of local businesses in the area to international standards, stimulating growth and positive change, benefitting not only our foreign visitors, but also our unique and beloved city.
Our credibility will be based on offering quality reading, great looking magazine and reliable reviews.
This is the first and only high quality printed magazine on the Brazilian market and it is with great pleasure that we share it with you and our new readers!
The Ipanema VIBE team is a group of entrepreneurs and professionals, all with specific knowledge about various aspects of Ipanema, who have come together with the aim and desire to put together a high end and informative media publication which will make a difference!
It is our belief that our shared collective knowledge and passion for Ipanema has the capability to create a special and unique experience for our visitors.
Ipanema is our place of residence and social interaction. Many friends from abroad have experienced our more personal guidance and we believe that with Ipanema VIBE we will be able to reach out to a much wider range of foreigners in Rio who, so far, had limited source of reliable guides.


Shows an example of a realtime timeline built with hapi and the nes plugin. The database used is RethinkDB.
Generate new timeline entry


Handcrafted, home-made masterpieces
Premium Materials
Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.
Fast Shipping
We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.
Quality Assurance
For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.
Tenor Trombone
$600
Lorem, ipsum.
Lorem, ipsum.
Lorem, ipsum dolor.
Lorem, ipsum.
Bass Trombone
$900
Lorem, ipsum.
Lorem, ipsum.
Lorem, ipsum dolor.
Lorem, ipsum.
Valve Trombone
$1200
Lorem, ipsum.
Lorem, ipsum.
Lorem, ipsum dolor.
Lorem, ipsum.


hi, I have tried to use the Gecodej.jar within Eclipse but it is giving me error, saying Gecode native code can't be loaded. How can I use Gecode/J with other application ? With regards Debdeep


The text
input is used for for the text to display within the alert. This in put uses the [innerHtml]
attribute. Alternatively, you can provide text between the bc-alert
opening and closing tag.
{{code.text}}
The dismissible
input is used to created alerts that can be closed with user action. Dismissible alerts have a close button on the far right of the alert. Defaults to false
.
{{code.dismissible}}
The hidden
input is used to make an alert hidden on page load. Defaults to false.
{{code.hidden}}
The type
input is used to determine what type of alert to show. Acceptable values are: success
, info
, warning
, and danger
. Defaults to success.
{{code.type}}


@* * Copyright 2022 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @this(input: Input) @(form:Form[_], fieldName: String, label: String)(implicit messages: Messages) @import uk.gov.hmrc.play.validators.AddressFields._