小编hid*_*urn的帖子

通过 Java/Spring Boot 连接 Docker Elasticsearch 实例

我正在从 Docker 运行 Elasticsearch 实例。图像来自 jHipster docker hub 存储库:jhipster/jhipster-elasticsearch/ - 我使用图像 v1.3.2,因为我需要 Elasticsearch 2.4.0(与项目的 Spring Boot 版本一致)。

我正在启动 ES 容器以及 Logstash 和 Kibana 图像,使用docker-compose. 这是启动ES容器的设置:

jhipster-elasticsearch:
    image: jhipster/jhipster-elasticsearch:v1.3.2
    ports:
        - 9400:9200
        - 9500:9300
    volumes:
       - ./log-es-config/elasticsearch_custom.yml:/usr/share/elasticsearch/config/elasticsearch.yml
Run Code Online (Sandbox Code Playgroud)

所以我将 9400 用于 REST,将 9500 用于传输通信。

这是elasticsearch_custom.yml安装到 ES配置的内部配置:

cluster.name: "log-cluster"
node.name: "log-node"
http.host: 0.0.0.0
transport.host: 127.0.0.1
transport.tcp.port: 9500
transport.publish_port: 9500
Run Code Online (Sandbox Code Playgroud)

当我启动容器时,这就是我得到的http://localhost:9400/_nodes

"cluster_name": "log-cluster",
  "nodes": {
    "xLsGj2DyTdCF89I7sAToVw": {
      "name": "log-node",
      "transport_address": "127.0.0.1:9500",
      "host": "127.0.0.1",
      "ip": "127.0.0.1",
      "version": "2.4.0", …
Run Code Online (Sandbox Code Playgroud)

java elasticsearch docker spring-boot docker-compose

6
推荐指数
1
解决办法
3984
查看次数

为生成的类添加xml根元素注释的方法?

我已经从 WSDL 文件生成了 JAXB 类,我想要做的是将 XML 转换为 Java 对象。这是生成的 JAXB 类示例:

XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GetProductListResponse", propOrder = {
    "productList",
    "productListDate",
    "failed",
    "failedDescription"
})
public class GetProductListResponse {

@XmlElementRef(name = "ProductList", namespace = "http://productService.productsdata", type = JAXBElement.class, required = false)
protected JAXBElement<ArrayOfProductListDetail> productList;
@XmlElementRef(name = "ProductListDate", namespace = "http://productService.productsdata", type = JAXBElement.class, required = false)
protected JAXBElement<String> productListDate;
@XmlElement(name = "Failed")
protected boolean failed;
@XmlElement(name = "FailedDescription", required = true, nillable = true)
protected String failedDescription;

...
}
Run Code Online (Sandbox Code Playgroud)

我需要转换为GetProductListResponse对象的 …

java xml wsdl jaxb

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×2

docker ×1

docker-compose ×1

elasticsearch ×1

jaxb ×1

spring-boot ×1

wsdl ×1

xml ×1