You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "11huangxing (via GitHub)" <gi...@apache.org> on 2023/03/13 08:54:25 UTC

[GitHub] [dubbo] 11huangxing opened a new issue, #11805: How to obtain a ReferenceBean through ip, port, interface, group, and payload

11huangxing opened a new issue, #11805:
URL: https://github.com/apache/dubbo/issues/11805

   
   I used to use version 2.7.14. Because of the serialization problem, I need to upgrade to version 3.1.7. But I don't know how to get the ReferenceBean through ip, port, interface, group, and payload in version 3.1.7; Here is my previous code:
   
   ReferenceBean<T> referenceBean = new ReferenceBean<>();
               referenceBean.setApplicationContext(applicationContext);
               referenceBean.setInterface(serviceClass);
               if (timeout != null)
               {
                   referenceBean.setTimeout(timeout);
               }
   
               if (StringUtils.isNotBlank(group))
               {
                   referenceBean.setGroup(group);
               }
               if (StringUtils.isNotBlank(ip) && port > 0)
               {
                   referenceBean.setUrl("dubbo://" + ip + ":" + port);
               }
               ProtocolConfig protocolConfig = getBean(ProtocolConfig.class);
               if (protocolConfig.getPayload() != null)
               {
                   Map<String, String> refParams = referenceBean.getParameters();
                   if (null == refParams)
                   {
                       refParams = new HashMap<>();
                   }
   
                   refParams.put(Constants.PAYLOAD_KEY, protocolConfig.getPayload().toString());
                   log.debug("magic set reference config parameters: {}", refParams);
                   referenceBean.setParameters(refParams);


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] 11huangxing closed issue #11805: How to set ReferenceBean with ip, port, interface, group, and payload

Posted by "11huangxing (via GitHub)" <gi...@apache.org>.
11huangxing closed issue #11805: How to set ReferenceBean with ip, port, interface, group, and payload
URL: https://github.com/apache/dubbo/issues/11805


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] MieAh commented on issue #11805: How to set ReferenceBean with ip, port, interface, group, and payload

Posted by "MieAh (via GitHub)" <gi...@apache.org>.
MieAh commented on issue #11805:
URL: https://github.com/apache/dubbo/issues/11805#issuecomment-1466614487

   You can create a ReferenceBean by chaining through ReferenceBeanBuilder, which can meet your needs of taking me with you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org