You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "allthingssecurity (via GitHub)" <gi...@apache.org> on 2026/10/06 00:05:22 UTC

[PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

allthingssecurity opened a new pull request, #27394:
URL: https://github.com/apache/camel/pull/27394

   # Description
   
   [CAMEL-25318](https://issues.apache.org/jira/browse/CAMEL-25318)
   
   An 8-bit short message holds 140 octets and the splitter splits the encoded bytes, but `SmppSmCommand.createSplitter` created the 8-bit splitter with the length of the body as a `String`. Bytes that decode to fewer characters (non-ASCII text in the UTF-8 exchange charset, binary data with valid UTF-8 sequences) were sent as one short message of more than 140 octets. In addition `SmppSplitter.split` applied the 255 segment limit before counting the last partial segment, so 255 full segments plus a few bytes gave 256 segments with the total 0 in the UDH.
   
   This change creates the 8-bit splitter with the length of the encoded message and counts the partial segment before the limit, so 255 full segments plus a remainder are truncated to 255 segments like any longer message. ASCII/ISO-8859-1 messages and messages within 255 segments are split as before.
   
   Tests: new `SmppSplitBodyTest` (3 fail without the change, 140 bytes unsplit is the control); module: 141 tests pass.
   
   Found with a Lean 4 model of the decision and the segment arithmetic: "every short message has at most 140 octets, at most 255 segments" fails on main and is proved for the fix, which equals main whenever main stays within 255 segments.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
     (I built and tested the affected module, including the formatter and import-sort plugins. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "allthingssecurity (via GitHub)" <gi...@apache.org>.
allthingssecurity commented on PR #27394:
URL: https://github.com/apache/camel/pull/27394#issuecomment-6010302089

   Thanks for the review. Addressed in f391e2c85cc5 (the branch was rebased on main first, to put the upgrade-guide note under the existing camel-smpp heading, so the first commit is now f2ad3bf5bd8c):
   
   - `SmppNLSTSplitter.split` had the same clamp before the remainder. The segment count is now a shared helper, `SmppSplitter.getSegmentCount`, used by both splitters. New `SmppNLSTSplitterTest.splitIntoAtMost255Segments` (255 full segments + 1 byte) fails without the change (`expected: <255> but was: <256>`) and passes with it; it also checks the total and the segment number in each UDH.
   - Upgrade guide: `==== 8-bit messages are split by their length in bytes` under the camel-smpp section. It says that multi-byte 8-bit bodies are now split, and with `splittingPolicy=TRUNCATE`/`REJECT` truncated or rejected instead of going out as one oversize PDU.
   
   camel-smpp: 147 unit tests pass.
   
   _Claude Code on behalf of allthingssecurity_
   


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27394:
URL: https://github.com/apache/camel/pull/27394#issuecomment-6010260031

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-smpp`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 9 of 698 tested, 27 compile-only — current: 9 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **9 affected modules** (current approach: 9).
   
   **Skip-tests mode would test 9 modules** (1 direct + 8 downstream), **skip tests for 27** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (9)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-route-parser
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   - `camel-smpp` ← components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java, components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSplitter.java, components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSplitBodyTest.java
   - `camel-yaml-dsl-validator` ← downstream of org.apache.camel:camel-catalog
   - `camel-yaml-dsl-validator-maven-plugin` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   
   </details>
   
   <details><summary>Modules with tests skipped (27)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (36 modules, 4m 43s total)</summary>
   
   **Total reactor time:** 4m 43s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: JBang :: Plugin :: TUI | 36.8s | SUCCESS |
   | Camel :: Launcher | 35.0s | SUCCESS |
   | Camel :: JBang :: MCP | 30.1s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 18.5s | SUCCESS |
   | Camel :: SMPP | 18.5s | SUCCESS |
   | Camel :: YAML DSL | 16.4s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 15.7s | SUCCESS |
   | Camel :: Component DSL | 14.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 14.3s | SUCCESS |
   | Camel :: Docs | 12.6s | SUCCESS |
   | Camel :: Kamelet Main | 11.6s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 10.5s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 6.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 6.6s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 6.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 4.5s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 4.0s | SUCCESS |
   | Camel :: All Components Sync point | 3.5s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.6s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 2.3s | SUCCESS |
   | Camel :: Catalog :: Maven | 1.7s | SUCCESS |
   | Camel :: Assembly | 1.5s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.2s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 1.1s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 0.9s | SUCCESS |
   | Camel :: JBang :: Integration tests | 0.8s | SUCCESS |
   | Camel :: Coverage | 0.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.7s | SUCCESS |
   | Camel :: Catalog :: Console | 0.6s | SUCCESS |
   | Camel :: JBang :: Main | 0.6s | SUCCESS |
   | Camel :: Launcher :: Container | 0.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.4s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: JBang :: Plugin :: TUI` (36.8s)
   - `Camel :: Launcher` (35.0s)
   - `Camel :: JBang :: MCP` (30.1s)
   - `Camel :: Catalog :: Camel Catalog` (18.5s)
   - `Camel :: SMPP` (18.5s)
   - `Camel :: YAML DSL` (16.4s)
   - `Camel :: YAML DSL :: Validator` (15.7s)
   - `Camel :: Component DSL` (14.8s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (14.3s)
   - `Camel :: Docs` (12.6s)
   - `Camel :: Kamelet Main` (11.6s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (10.5s)
   - `Camel :: YAML DSL :: Deserializers` (6.6s)
   - `Camel :: JBang :: Plugin :: Testing` (6.6s)
   - `Camel :: Catalog :: Camel Route Parser` (6.2s)
   - `Camel :: JBang :: Plugin :: Validate` (4.5s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (4.0s)
   - `Camel :: All Components Sync point` (3.5s)
   - `Camel :: Catalog :: Suggest (deprecated)` (2.6s)
   - `Camel :: YAML DSL :: Maven Plugins` (2.3s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37392110056)


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27394:
URL: https://github.com/apache/camel/pull/27394#issuecomment-6010022153

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27394:
URL: https://github.com/apache/camel/pull/27394#discussion_r4192760648


##########
components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java:
##########
@@ -77,7 +77,13 @@ private SmppSplittingPolicy getSplittingPolicy(Message message) throws SmppExcep
         return config.getSplittingPolicy();
     }
 
-    protected SmppSplitter createSplitter(Message message) throws SmppException {
+    /**
+     * Creates the splitter for the message.
+     *
+     * @param message      the message
+     * @param shortMessage the body of the message, encoded as it is sent
+     */
+    protected SmppSplitter createSplitter(Message message, byte[] shortMessage) throws SmppException {

Review Comment:
   Nit: replacing `createSplitter(Message)` instead of overloading it means a user subclass that overrides the old method still compiles but its override silently stops being called. Keeping a `@Deprecated createSplitter(Message)` that the new one falls back to would avoid that. It is documented in the upgrade guide, so not blocking.



-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27394:
URL: https://github.com/apache/camel/pull/27394


-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "allthingssecurity (via GitHub)" <gi...@apache.org>.
allthingssecurity commented on code in PR #27394:
URL: https://github.com/apache/camel/pull/27394#discussion_r4192004478


##########
components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java:
##########
@@ -92,7 +92,8 @@ protected SmppSplitter createSplitter(Message message) throws SmppException {
         String body = message.getBody(String.class);
 
         if (SmppUtils.is8Bit(alphabet)) {
-            splitter = new Smpp8BitSplitter(body.length());
+            // an 8-bit message is split by its length in bytes
+            splitter = new Smpp8BitSplitter(getShortMessage(message).length);

Review Comment:
   Done in f391e2c85cc5: `splitBody` passes the encoded `shortMessage` to `createSplitter(Message, byte[])`, so the body is converted once. The method is protected, so the upgrade-guide note mentions the new parameter.
   
   _Claude Code on behalf of allthingssecurity_
   



##########
components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSplitBodyTest.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smpp;
+
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.DefaultExchange;
+import org.jsmpp.bean.Alphabet;
+import org.jsmpp.session.SMPPSession;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+
+/**
+ * An 8-bit short message holds 140 octets: the body must be split by its length in bytes, into at most 255 segments.
+ */
+class SmppSplitBodyTest {
+
+    private SmppSubmitSmCommand command;
+
+    @BeforeEach
+    void setUp() {
+        command = new SmppSubmitSmCommand(mock(SMPPSession.class), new SmppConfiguration());
+    }
+
+    @Test
+    void eightBitBinaryBodyOfMoreThan140BytesIsSplit() throws Exception {
+        // 150 bytes, which happen to be 50 valid UTF-8 sequences (50 characters when read as a String)
+        byte[] body = new byte[150];
+        for (int i = 0; i < body.length; i += 3) {
+            body[i] = (byte) 0xE2;
+            body[i + 1] = (byte) 0x82;
+            body[i + 2] = (byte) 0xAC;
+        }
+
+        byte[][] segments = splitEightBit(body);
+
+        assertEquals(2, segments.length, "a body of 150 bytes needs two segments");
+        assertSegments(body, segments);
+    }
+
+    @Test
+    void eightBitTextBodyOfMoreThan140BytesIsSplit() throws Exception {
+        // 100 characters, 200 bytes in UTF-8 (the charset of the exchange)
+        String text = "é".repeat(100);
+
+        byte[][] segments = splitEightBit(text);
+
+        assertEquals(2, segments.length, "a body of 200 bytes needs two segments");
+        assertSegments(text.getBytes(StandardCharsets.UTF_8), segments);

Review Comment:
   Done in f391e2c85cc5: the test helper sets `Exchange.CHARSET_NAME` to UTF-8 on the exchange.
   
   _Claude Code on behalf of allthingssecurity_
   



-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27394:
URL: https://github.com/apache/camel/pull/27394#discussion_r4191866556


##########
components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java:
##########
@@ -92,7 +92,8 @@ protected SmppSplitter createSplitter(Message message) throws SmppException {
         String body = message.getBody(String.class);
 
         if (SmppUtils.is8Bit(alphabet)) {
-            splitter = new Smpp8BitSplitter(body.length());
+            // an 8-bit message is split by its length in bytes
+            splitter = new Smpp8BitSplitter(getShortMessage(message).length);

Review Comment:
   Nit: the short message is now converted twice per send (here and in `splitBody`). Passing the already computed `shortMessage` into `createSplitter` would avoid that.



##########
components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppSplitBodyTest.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smpp;
+
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.support.DefaultExchange;
+import org.jsmpp.bean.Alphabet;
+import org.jsmpp.session.SMPPSession;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+
+/**
+ * An 8-bit short message holds 140 octets: the body must be split by its length in bytes, into at most 255 segments.
+ */
+class SmppSplitBodyTest {
+
+    private SmppSubmitSmCommand command;
+
+    @BeforeEach
+    void setUp() {
+        command = new SmppSubmitSmCommand(mock(SMPPSession.class), new SmppConfiguration());
+    }
+
+    @Test
+    void eightBitBinaryBodyOfMoreThan140BytesIsSplit() throws Exception {
+        // 150 bytes, which happen to be 50 valid UTF-8 sequences (50 characters when read as a String)
+        byte[] body = new byte[150];
+        for (int i = 0; i < body.length; i += 3) {
+            body[i] = (byte) 0xE2;
+            body[i + 1] = (byte) 0x82;
+            body[i + 2] = (byte) 0xAC;
+        }
+
+        byte[][] segments = splitEightBit(body);
+
+        assertEquals(2, segments.length, "a body of 150 bytes needs two segments");
+        assertSegments(body, segments);
+    }
+
+    @Test
+    void eightBitTextBodyOfMoreThan140BytesIsSplit() throws Exception {
+        // 100 characters, 200 bytes in UTF-8 (the charset of the exchange)
+        String text = "é".repeat(100);
+
+        byte[][] segments = splitEightBit(text);
+
+        assertEquals(2, segments.length, "a body of 200 bytes needs two segments");
+        assertSegments(text.getBytes(StandardCharsets.UTF_8), segments);

Review Comment:
   Nit: this relies on the String-to-bytes conversion using UTF-8, which depends on the exchange or platform default charset (not guaranteed on JDK 17). Setting `Exchange.CHARSET_NAME` to UTF-8 on the exchange makes it deterministic.



-- 
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: commits-unsubscribe@camel.apache.org

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


Re: [PR] CAMEL-25318: camel-smpp - split an 8-bit message by its length in bytes, into at most 255 segments [camel]

Posted by "allthingssecurity (via GitHub)" <gi...@apache.org>.
allthingssecurity commented on code in PR #27394:
URL: https://github.com/apache/camel/pull/27394#discussion_r4192810564


##########
components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java:
##########
@@ -77,7 +77,13 @@ private SmppSplittingPolicy getSplittingPolicy(Message message) throws SmppExcep
         return config.getSplittingPolicy();
     }
 
-    protected SmppSplitter createSplitter(Message message) throws SmppException {
+    /**
+     * Creates the splitter for the message.
+     *
+     * @param message      the message
+     * @param shortMessage the body of the message, encoded as it is sent
+     */
+    protected SmppSplitter createSplitter(Message message, byte[] shortMessage) throws SmppException {

Review Comment:
   Agreed, thanks. A deprecated overload would not help an existing override (the new two-argument method would still be the one called), so in 144b465cb73a I went back to the original `createSplitter(Message)` signature: the 8-bit branch encodes the body again for its length, which costs one extra conversion per 8-bit send but keeps subclasses that override it working. The upgrade-guide sentence about the new parameter is removed. Module tests: 147 pass.
   
   _Claude Code on behalf of allthingssecurity_



-- 
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: commits-unsubscribe@camel.apache.org

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