You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/07/06 08:23:31 UTC

[I] [Enhancement] Do some code optimization.[StreamTopicConfig] (eventmesh)

Alonexc opened a new issue, #4192:
URL: https://github.com/apache/eventmesh/issues/4192

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://github.com/apache/eventmesh/assets/91315508/ce496cf8-d68c-4867-8294-dbb21b7e18ce)
   ![image](https://github.com/apache/eventmesh/assets/91315508/c017d023-dc16-4ff8-92ac-5ac8d40730f4)
   ![image](https://github.com/apache/eventmesh/assets/91315508/5a240a19-8168-441a-b6a6-c3a1f2b3e3f2)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/consumer/consumergroup/StreamTopicConfig.java line 69,86,118
   analysis and explanation:
   a. transient is used to mark fields in a Serializable class which will not be written out to file (or stream). In a class that does not implement Serializable, this modifier is simply wasted keystrokes, and should be removed.
   b. This method builds a key for a map, using a StringBuilder, either implicitly or explicitly. This means the type of the key is something more than a String constant, it is a properly formatted String. However, there is no type based verification that all uses of this key will follow this formatting. It is much better to use a proper, simple, bean class that holds two (or more) fields so that it is clear what is expected for key use.
   c. Remove useless curly braces around statement
   
   
   ### Describe the solution you'd like
   
   a. implements serializable or remove ` transient `
   ![image](https://github.com/apache/eventmesh/assets/91315508/762b6fe8-8b37-46ee-b281-37c017a9463e)
   b. create a method and change the hard-coding.
   ![image](https://github.com/apache/eventmesh/assets/91315508/651c8814-ece2-4cbb-b1ca-7a92fe971bda)
   ![image](https://github.com/apache/eventmesh/assets/91315508/8931750d-7900-4bb5-beba-5b96bb084f08)
   ![image](https://github.com/apache/eventmesh/assets/91315508/165b4848-f032-41a2-97ad-684155dbb967)
   c. replace with expression lambda
   ![image](https://github.com/apache/eventmesh/assets/91315508/66cd0d02-aac4-4b41-a479-9f2136ac5f6a)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: issues-unsubscribe@eventmesh.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] Do some code optimization.[StreamTopicConfig] (eventmesh)

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm closed issue #4192: [Enhancement] Do some code optimization.[StreamTopicConfig]
URL: https://github.com/apache/eventmesh/issues/4192


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org