我一直非常有兴趣尝试将微服务/ SOA作为一种架构,并且很难概念化服务之间的集成是如何实现的.
我喜欢使用消息传递将客户端与服务分离的想法,但不了解系统如何专门使用它.典型的异步操作和发布/订阅内容显然是有意义的 - 例如创建新订单,广播报告数据等.我不明白的是人们是否通常尝试将消息传递用于常见的请求/回复场景 - 例如,用户点击他们的"个人资料"页面,并且需要在页面上呈现的部分数据来自用户服务.
我知道常见的消息传递实现提供类似REST的回复/请求功能,但是它通常用于简单的数据请求吗?微服务似乎更有可能暴露REST端点并向消息代理注册它将参与的不同类型的通信,但我所看到的SOA和微服务架构的所有这些演示似乎都暗示它们只使用其中一种. .
感谢您的任何精心设计/经验!
我正在尝试向REST端点发送一个简单的POST请求.我有一个简单的pojo,我想在有效载荷中发送为JSON.这是pojo(请注意我使用Spring与Grails集成,因此pojo/service在Groovy中):
class Person implements Serializable {
String name
}
Run Code Online (Sandbox Code Playgroud)
这是我的门户:
public interface PersonGateway {
Person savePerson(Person person)
}
Run Code Online (Sandbox Code Playgroud)
以下是布线的重要部分:
<int:channel id="requestChannel" />
<int:channel id="responseChannel" />
<int:header-enricher input-channel="requestChannel">
<int:header name="Content-Type" value="application/json" />
</int:header-enricher>
<int:gateway id="PersonGateway"
service-interface="com.example.PersonGateway"
default-request-channel="requestChannel"
default-reply-channel="responseChannel">
<int:method name="savePerson" />
</int:gateway>
<int-http:outbound-gateway url="http://127.0.0.1:8000/person"
http-method="POST"
message-converters="jsonConverter"
expected-response-type="com.example.Person"
request-channel="requestChannel"
extract-request-payload="false"/>
Run Code Online (Sandbox Code Playgroud)
此POST请求永远不会到达该服务,但不会抛出任何异常.当我记录所有级别时,我得到的唯一一个看起来像线索的是:
2014-03-30 16:35:07,313 [main] DEBUG outbound.HttpRequestExecutingMessageHandler - 无法尝试转换消息有效负载类型.组件'org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler#0'没有显式的ConversionService引用,并且上下文中没有'integrationConversionService'bean.
除此之外它不会给我太多.我一整天都在尝试一些小事情,似乎无处可去.有人看到我错过了吗?谢谢!
我正在从Jenkins Docker 映像创建一个映像并尝试安装 SCM 同步配置插件。我创建了一个密钥,我将其复制到图像中,该图像也复制到 Github 存储库的 ssh 密钥中。我试图创建.ssh/的文件夹/root以及/var/jenkins_home。我按照这个例子并尝试将两个键添加到/etc/ssh/ssh_config. 这没有用。我还尝试遵循另一个答案(丢失了指向它的链接),您可以在其中添加一个包含以下内容的config文件.ssh/:
Host github
HostName github.com
User git
IdentityFile "/var/jenkins_home/.ssh/id_rsa"
Run Code Online (Sandbox Code Playgroud)
这也不起作用。我正在使用凭证插件 + Git 插件和凭证入口点在/var/jenkins_home/.ssh/id_rsa file.
有没有人在 Docker 映像中与 Jenkins 一起使用这个插件或 git 集成?我得到的错误如下:
信息:为 url 创建 SCM 存储库对象:git@github.com:MY_REPO/scm-sync.git 2014 年 11 月 25 日上午 4:20:30 hudson.plugins.scm_sync_configuration.scms.SCM getConfiguredRepository 严重:创建 ScmRepository 时出错:没有这样提供者:'github.com'。2014 年 11 月 25 日上午 4:20:30 jenkins.model.Jenkins 警告:null java.lang.RuntimeException:ScmSyncConfiguration 初始化期间出错!在 hudson.plugins.scm_sync_configuration.ScmSyncConfigurationPlugin.init(ScmSyncConfigurationPlugin.java:154) 在 hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationItemListener.onLoaded(ScmSyncConfigurationItemListener.java:24) 在 jenkins.model.Jenkins8.(4).java在 …