apollo

Windows 下运行 Apollo配置中心

偶尔善良 提交于 2020-01-09 21:50:36
首先重要一点,要在windows下运行启动脚本demo.sh的前提是安装"MingW"不能用“CygWin”。因为在CygWin里运行java会报找不到jar文件的问题。 Apollo 项目:(源码) https://github.com/ctripcorp/apollo Apollo 的 Quick Start 项目:(编译好的) https://github.com/nobodyiam/apollo-build-scripts 我们这里直接下载这个 Quick Start 的项目来运行。 下载zip好之后解压,或直接克隆项目。 建库:运行sql目录中的两个sql脚本,如果原来有库注意备份。 编辑:demo.sh 最前面几行: #apollo config db info apollo_config_db_url=jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8 apollo_config_db_username=用户名 apollo_config_db_password=密码(如果没有密码,留空即可) # apollo portal db info apollo_portal_db_url=jdbc:mysql://localhost:3306/ApolloPortalDB

apollo 配置中心搭建

别说谁变了你拦得住时间么 提交于 2020-01-09 13:34:24
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 本地搭建过程 1.启动Assembly(一套环境[dev,test,prod]启动一套,包含一个adminServer和一个configServer) 启动参数 -Dapollo_profile=github -Dspring.datasource.url=jdbc:mysql://localhost:3306/ApolloConfigDB -DcharacterEncoding=utf8 -Dspring.datasource.username=root -Dspring.datasource.password=root -Dlogging.file=/Users/*/logs/apollo-assembly.log 2.启动一套portal portal启动的时候需要制定各个环境的env_meta的地址,ServerConfig表中配置 apollo.portal.envs的值 dev,test,prod 新增多个环境 -Dapollo_profile=github,auth -Ddev_meta=http://localhost:8080/ -Dtest_meta=http://localhost:8080/ -Dserver.port=8070 -Dspring.datasource.url=jdbc

How to fix Error: Type “Extra” was defined more than once in apollo-server, using graphql

本小妞迷上赌 提交于 2020-01-07 09:33:28
问题 Problem Hi devs, I have defined two schemas that technically have the same type, but I get the following error: Error: Type "Extra" was defined more than once. Is there a way to solve this problem? My apologies, apollo is new to me and I would really appreciate your help to solve this. Thanks in advance! Schema #1 const {gql} = require('apollo-server'); typeDefs = gql ` extend type Query{ search(q: String!): [Content!]! } type Content{ id: String! title: String! sinopsis: String! poster:

How to fix Error: Type “Extra” was defined more than once in apollo-server, using graphql

拥有回忆 提交于 2020-01-07 09:32:52
问题 Problem Hi devs, I have defined two schemas that technically have the same type, but I get the following error: Error: Type "Extra" was defined more than once. Is there a way to solve this problem? My apologies, apollo is new to me and I would really appreciate your help to solve this. Thanks in advance! Schema #1 const {gql} = require('apollo-server'); typeDefs = gql ` extend type Query{ search(q: String!): [Content!]! } type Content{ id: String! title: String! sinopsis: String! poster:

Call a fetch API which is stored once in using apollo cache?

◇◆丶佛笑我妖孽 提交于 2020-01-07 08:18:56
问题 I have been working on Apollo GQL. I'm using apollo cache to reduce unwanted API calls. The probelm now I'm facing is when i have updated a data i should not re-fetch the data because the API is already called once and stored in cache. Thing i wanted to do is either clear cache for a particular query or refetch the datas from server.!! I can't clear the entire cache, cause i'm calling a lot of APIs i have to re-fetch the data after the following mutation call. const [ reopenInvoice, { loading

开源基础框架 csx-bsf-all【开源】【原创】

佐手、 提交于 2020-01-07 01:01:16
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 开源csx-bsf-all Git地址 https://gitee.com/yhcsx/csx-bsf-all ​ 技术架构 彩食鲜技术架构概述 介绍 BSF 为 base service framework 的简写,定义为技术团队的基础框架,用于基础服务的集成和跟业务无关的基础技术集成。 BSF集成了自研的监控报警,用来监控各个服务系统的性能及异常告警。集成并封装Apollo,Rocket MQ,Redis, Elastic Search,ELK,XXLJOB, Sharding JDBC,Cat,Eureka,七牛云等第三方中间件,提供简易使用的底层框架。 愿景 为了更好地支持业务开发,让开发人员从中间件中解放出来,专注业务以提高开发效率。同时基础框架集中统一优化中间件相关服务及使用,为开发人员提供高性能,更方便的基础服务接口及工具。 项目结构规范说明 csx-bsf-all -- csx-bsf-core (项目核心类库) -- csx-bsf-demo (项目集成使用demo) -- csx-bsf-dependencies (项目依赖pom定义) -- README.md (说明文档,必须有) -- csx-bsf-starter (项目full-start包) -- csx-bsf-elk

How to iterate json nested array in graphql scheme

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 04:45:12
问题 I have the following JSON output from my NodeJS Apollo server: attributes: [ { id: 8, name: 'Size', position: 0, visible: true, variation: true, options: [Array] } ], Now I want to create a graphql scheme for this. I can access all the items like id, position, visible.. but the options I can't access. How can I write the graphql scheme for this? Current scheme is: const ProductAttributes = ` type ProductAttributes { id: Int! name: String! position: String! visible: Boolean! Variation: Boolean

Apollo GraphQL - Import .graphql schema as typeDefs

跟風遠走 提交于 2020-01-05 03:50:08
问题 With graphql-yoga you can simply import your schema by doing the following: typeDefs: './src/schema.graphql' . Is there a similar way of doing so with apollo-server-express? If there isn't, how does one import the typeDefs from an external .graphql file? 回答1: I found a way of doing this by using grahpql-import which does exactly what I needed. See sample code below: import { ApolloServer } from 'apollo-server-express' import { importSchema } from 'graphql-import' import Query from '.

MQTT——服务器搭建(一)

混江龙づ霸主 提交于 2020-01-01 18:04:31
本文转载自: https://www.cnblogs.com/chenrunlin/p/5090916.html 作者:chenrunlin 转载请注明该声明。 MQTT介绍 MQTT,是IBM推出的一种针对移动终端设备的基于TCP/IP的发布/预订协议,可以连接大量的远程传感器和控制设备: 轻量级的消息订阅和发布(publish/subscribe)协议 建立在TCP/IP协议之上 IoT,internet of things,物联网,MQTT在这方面应用较多。 MQTT协议是针对如下情况设计的: M2M(Machine to Machine) communication,机器端到端通信,比如传感器之间的数据通讯 因为是Machine to Machine,需要考虑: Machine,或者叫设备,比如温度传感器,硬件能力很弱,协议要考虑尽量小的资源消耗,比如计算能力和存储等 M2M可能是无线连接,网络不稳定,带宽也比较小 MQTT协议的架构,用一个示例说明。比如有1个温度传感器(1个Machine),2个小的显示屏(2个Machine),显示屏要显示温度传感器的温度值。 显示器需要先通过MQTT协议subscribe(订阅)一个比如叫temperature的topic(主题): 当温度传感器publish(发布)温度数据,显示器就可以收到了: 注:以上两张图,取自 MQTT

Accessing Request object in Apollo Server with ExpressJS

扶醉桌前 提交于 2019-12-31 05:41:08
问题 Is there any way of accessing the request object from the underlying express app in Apollo Server 回答1: The context configuration parameter can be either an object, a function that returns the object, or a function that returns a promise to return the object. This function would get the HTTP request as a parameter, and could be defined like so: const apolloServer = new ApolloServer({ schema, context: async ({ req }) => { const something = getSomething(req) return { something } }, })